home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / DShowIDL / dvdif.idl < prev    next >
Encoding:
Text File  |  2002-11-12  |  90.7 KB  |  2,327 lines

  1. //------------------------------------------------------------------------------
  2. // File: DVDIf.idl
  3. //
  4. // Desc: DirectShow interfaces to control playback of a DVD filter graph.
  5. //
  6. // Copyright (c) 1992-2002, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9.  
  10. // forward declarations - these are the interfaces declared in this file
  11.  
  12. import "unknwn.idl";
  13. import "objidl.idl";
  14.  
  15. cpp_quote("#include <ddraw.h>")
  16.  
  17. interface IDvdControl;
  18. interface IDvdInfo;
  19. interface IDirectDraw;
  20. interface IDirectDrawSurface;
  21. interface IDvdGraphBuilder ;
  22. interface IDDrawExclModeVideo;
  23. interface IDDrawExclModeVideoCallback;
  24. interface IDvdCmd;
  25. interface IDvdState;
  26.  
  27.  
  28. //==========================================================================
  29. //==========================================================================
  30. //
  31. // typedefs used by IDvdControl and IDvdInfo interfaces.
  32. //
  33. //==========================================================================
  34. //==========================================================================
  35.  
  36. typedef enum tagDVD_DOMAIN {
  37.     // The DVD_DOMAIN is used to indicate the stat of a DVD player.
  38.     DVD_DOMAIN_FirstPlay=1,       // doing default initialization of a dvd disc
  39.     DVD_DOMAIN_VideoManagerMenu,  // displaying menus for whole disc
  40.     DVD_DOMAIN_VideoTitleSetMenu, // displaying menus for current title set
  41.     DVD_DOMAIN_Title,             // displaying current title
  42.     DVD_DOMAIN_Stop               // player is in stopped state
  43. } DVD_DOMAIN;
  44.  
  45. typedef enum tagDVD_MENU_ID {
  46.     DVD_MENU_Title = 2,     // to choose a title from any VTS in a DVD-Video volume
  47.     DVD_MENU_Root = 3,      // main menu for a specific VTS 
  48.     DVD_MENU_Subpicture =4, // to choose subpicture stream in a VTS
  49.     DVD_MENU_Audio = 5,     // to choose audio stream in a VTS
  50.     DVD_MENU_Angle = 6,     // to choose angle num in a VTS
  51.     DVD_MENU_Chapter = 7    // to choose a chapter in a VTS
  52.     // the Root menu always provides a means of getting to to Subpicture, Audio, 
  53.     // Angle and Chapter menus if they exist.
  54. } DVD_MENU_ID;
  55.  
  56. typedef enum tagDVD_DISC_SIDE {
  57.     DVD_SIDE_A = 1,
  58.     DVD_SIDE_B = 2
  59. } DVD_DISC_SIDE;
  60.  
  61.  
  62. typedef enum tagDVD_PREFERRED_DISPLAY_MODE
  63. {
  64.     // DVD_PREFERRED_DISPLAY_MODE is used to indicate the user's
  65.     // preferred window aspect ratio and preferred method of converion of
  66.     // 16*9 content to a 4*3 window aspect ratio.  Pan-scan and letterboxing are
  67.     // the two conversion methods.  This enum is used to indicate only a preference of 
  68.     // conversion mechinism since some content can only be converted using one 
  69.     // of these methods.  4*3 content is converted to a 16*9 window always by using
  70.     // "reverse" letterboxing where black bars are added to the right and left 
  71.     // sides of the display instead of the top and bottom of the display as in the 16*9
  72.     // to 4*3 conversion useing letterboxing.
  73.     DISPLAY_CONTENT_DEFAULT = 0,    // default to content
  74.     DISPLAY_16x9 = 1,               // 16x9 display
  75.     DISPLAY_4x3_PANSCAN_PREFERRED = 2,   // 4x3 display with pan-scan preferrence
  76.     DISPLAY_4x3_LETTERBOX_PREFERRED = 3   // 4x3 display with letterbox preferrence
  77.  
  78. } DVD_PREFERRED_DISPLAY_MODE;
  79.  
  80. typedef WORD DVD_REGISTER;
  81. typedef DVD_REGISTER    GPRMARRAY[16]; // DVD-Video 1.0 has 16 16-bit General Parameter Registers
  82. typedef DVD_REGISTER    SPRMARRAY[24]; // DVD-Video 1.0 has 24 16-bit System Parameter Registers
  83.  
  84.  
  85.  
  86. // these are only for IDVDInfo1 compatibility and require the DVD-Video 1.0 specification
  87. // Please use the IDVDInfo2's DVD_Title/MenuAttributes, DVD_VideoAttributes, DVD_AudioAttributes, and DVD_SubpictureAttributes
  88. typedef struct tagDVD_ATR 
  89. {
  90.     //
  91.     // Refer to the DVD-Video 1.0 spec to parse these structures.
  92.     //
  93.     ULONG    ulCAT;     // VMG_CAT if this is for a volume; or VTS_CAT 
  94.                         //      if this is for a Video Title Set (VTS)
  95.     BYTE    pbATRI[768];// All stream attributes for menu and title from bytes
  96.                         //      256 to 1023 of VMGI or VTSI.
  97. } DVD_ATR;
  98. typedef BYTE DVD_VideoATR[2];   // video stream attributes.
  99. typedef BYTE DVD_AudioATR[8];   // audio stream attributes.
  100. typedef BYTE DVD_SubpictureATR[6]; // subpicture stream attributes.
  101.  
  102. // DVD1.0 Timecode is BCD encoded in this format: 0xHhMmSsFf, where
  103. //      H is tens of hours
  104. //      h is hours
  105. //      M is tens of minutes
  106. //      m is minutes
  107. //      S is tens of seconds
  108. //      s is seconds
  109. //      F is tens of frames
  110. //      f is frames
  111. // Note that you must know the frame rate to interperate the frame count as time.
  112. typedef enum tagDVD_FRAMERATE
  113. {
  114.     DVD_FPS_25 =1, // 25 frames per second
  115.     DVD_FPS_30NonDrop = 3 // exactly 30 frames per second
  116. } DVD_FRAMERATE;
  117.  
  118. cpp_quote("typedef struct tagDVD_TIMECODE")
  119. cpp_quote("{")
  120. cpp_quote("   ULONG Hours1    :4; // Hours")
  121. cpp_quote("   ULONG Hours10  :4; // Tens of Hours ")
  122. cpp_quote("")
  123. cpp_quote("   ULONG Minutes1  :4; // Minutes ")
  124. cpp_quote("   ULONG Minutes10:4; // Tens of Minutes ")
  125. cpp_quote("")
  126. cpp_quote("   ULONG Seconds1  :4; // Seconds ")
  127. cpp_quote("   ULONG Seconds10:4; // Tens of Seconds ")
  128. cpp_quote("")
  129. cpp_quote("   ULONG Frames1   :4; // Frames ")
  130. cpp_quote("   ULONG Frames10 :2; // Tens of Frames ")
  131. cpp_quote("")
  132. cpp_quote("   ULONG FrameRateCode: 2; // use DVD_FRAMERATE to indicate frames/sec and drop/non-drop")
  133. cpp_quote("} DVD_TIMECODE;")
  134.  
  135. //
  136. //  Newer IDVD2 methods can use the HMSF format instead
  137. // Call SetOption( DVD_HMSF_TimeCodeEvents, TRUE) to return EC_DVD_CURRENT_HMSF_TIME
  138. // instead of EC_DVD_CURRENT_TIME events
  139. //
  140. typedef enum tagDVD_TIMECODE_FLAGS
  141. {
  142.     DVD_TC_FLAG_25fps         = 0x00000001, // 25 frames per second
  143.     DVD_TC_FLAG_30fps         = 0x00000002, // 30 frames per second
  144.     DVD_TC_FLAG_DropFrame     = 0x00000004, // 29.97 instead of 30 fps
  145.     DVD_TC_FLAG_Interpolated  = 0x00000008, // timecode may be inaccurate
  146.     // remainder of bits are reserved and should not be read
  147. } DVD_TIMECODE_FLAGS;
  148.  
  149. // this can be cast to/from a ULONG
  150. typedef struct tagDVD_HMSF_TIMECODE
  151. {
  152.     BYTE    bHours;
  153.     BYTE    bMinutes;
  154.     BYTE    bSeconds;
  155.     BYTE    bFrames;
  156. } DVD_HMSF_TIMECODE;
  157.  
  158. typedef struct tagDVD_PLAYBACK_LOCATION2 
  159. {
  160.     //
  161.     // TitleNum & ChapterNum or TitleNum & TimeCode are sufficient to save 
  162.     // playback location for One_Sequential_PGC_Titles.
  163.     //
  164.     ULONG   TitleNum;   // title number for whole disc (TTN not VTS_TTN)
  165.     ULONG   ChapterNum; // part-of-title number with title. 0xffffffff if not Once_Sequential_PGC_Title
  166.     DVD_HMSF_TIMECODE   TimeCode;   // use DVD_TIMECODE for current playback time.
  167.     ULONG   TimeCodeFlags;  // union of DVD_TIMECODE_EVENT_FLAGS
  168.  
  169. } DVD_PLAYBACK_LOCATION2;
  170.  
  171. typedef struct tagDVD_PLAYBACK_LOCATION 
  172. {
  173.     //
  174.     // TitleNum & ChapterNum or TitleNum & TimeCode are sufficient to save 
  175.     // playback location for One_Sequential_PGC_Titles.
  176.     //
  177.     ULONG   TitleNum;   // title number for whole disc (TTN not VTS_TTN)
  178.     ULONG   ChapterNum; // part-of-title number with title. 0xffffffff if not Once_Sequential_PGC_Title
  179.     ULONG   TimeCode;   // use DVD_TIMECODE for current playback time. 0xffffffff if not Once_Sequential_PGC_Title
  180.  
  181. } DVD_PLAYBACK_LOCATION;
  182.  
  183. typedef DWORD VALID_UOP_SOMTHING_OR_OTHER;
  184.  
  185. typedef enum {
  186.                                                             //
  187.                                                             // Annex J User Functions ---
  188.                                                             //
  189.     UOP_FLAG_Play_Title_Or_AtTime           = 0x00000001,   // Title_Or_Time_Play
  190.     UOP_FLAG_Play_Chapter                   = 0x00000002,   // Chapter_Search_Or_Play
  191.     UOP_FLAG_Play_Title                     = 0x00000004,   // Title_Play
  192.     UOP_FLAG_Stop                           = 0x00000008,   // Stop
  193.     UOP_FLAG_ReturnFromSubMenu              = 0x00000010,   // GoUp
  194.     UOP_FLAG_Play_Chapter_Or_AtTime         = 0x00000020,   // Time_Or_Chapter_Search
  195.     UOP_FLAG_PlayPrev_Or_Replay_Chapter     = 0x00000040,   // Prev_Or_Top_PG_Search
  196.     UOP_FLAG_PlayNext_Chapter               = 0x00000080,   // Next_PG_Search
  197.     UOP_FLAG_Play_Forwards                  = 0x00000100,   // Forward_Scan
  198.     UOP_FLAG_Play_Backwards                 = 0x00000200,   // Backward_Scan
  199.     UOP_FLAG_ShowMenu_Title                 = 0x00000400,   // Title_Menu_Call
  200.     UOP_FLAG_ShowMenu_Root                  = 0x00000800,   // Root_Menu_Call
  201.     UOP_FLAG_ShowMenu_SubPic                = 0x00001000,   // SubPic_Menu_Call
  202.     UOP_FLAG_ShowMenu_Audio                 = 0x00002000,   // Audio_Menu_Call
  203.     UOP_FLAG_ShowMenu_Angle                 = 0x00004000,   // Angle_Menu_Call
  204.     UOP_FLAG_ShowMenu_Chapter               = 0x00008000,   // Chapter_Menu_Call
  205.     UOP_FLAG_Resume                         = 0x00010000,   // Resume
  206.     UOP_FLAG_Select_Or_Activate_Button      = 0x00020000,   // Button_Select_Or_Activate
  207.     UOP_FLAG_Still_Off                      = 0x00040000,   // Still_Off
  208.     UOP_FLAG_Pause_On                       = 0x00080000,   // Pause_On
  209.     UOP_FLAG_Select_Audio_Stream            = 0x00100000,   // Audio_Stream_Change
  210.     UOP_FLAG_Select_SubPic_Stream           = 0x00200000,   // SubPic_Stream_Change
  211.     UOP_FLAG_Select_Angle                   = 0x00400000,   // Angle_Change
  212.     UOP_FLAG_Select_Karaoke_Audio_Presentation_Mode = 0x00800000, // Karaoke_Audio_Pres_Mode_Change
  213.     UOP_FLAG_Select_Video_Mode_Preference           = 0x01000000  // Video_Pres_Mode_Change
  214. } VALID_UOP_FLAG ;
  215.  
  216. typedef enum {
  217.     DVD_CMD_FLAG_None               = 0x00000000,
  218.     DVD_CMD_FLAG_Flush              = 0x00000001,
  219.     DVD_CMD_FLAG_SendEvents         = 0x00000002,
  220.     DVD_CMD_FLAG_Block              = 0x00000004,    // block end
  221.     DVD_CMD_FLAG_StartWhenRendered  = 0x00000008,    // command "start" when the first frame is rendered
  222.     DVD_CMD_FLAG_EndAfterRendered   = 0x00000010,    // command "ends" after the last frame is rendered
  223. } DVD_CMD_FLAGS;
  224.  
  225. // For IDVDControl2::SetOption flags
  226. typedef enum {
  227.     DVD_ResetOnStop               = 1,  // default TRUE
  228.     DVD_NotifyParentalLevelChange = 2,  // default FALSE
  229.     DVD_HMSF_TimeCodeEvents       = 3,  // default FALSE (send DVD_CURRENT_TIME events)
  230.     DVD_AudioDuringFFwdRew        = 4   // default FALSE (or by reg)
  231. } DVD_OPTION_FLAG;
  232.  
  233. typedef enum {
  234.     DVD_Relative_Upper   = 1,
  235.     DVD_Relative_Lower   = 2,
  236.     DVD_Relative_Left    = 3,
  237.     DVD_Relative_Right   = 4
  238. } DVD_RELATIVE_BUTTON;
  239.  
  240. // Parental Level Information
  241. typedef enum tagDVD_PARENTAL_LEVEL
  242. {
  243.     DVD_PARENTAL_LEVEL_8 = 0x8000,
  244.     DVD_PARENTAL_LEVEL_7 = 0x4000,
  245.     DVD_PARENTAL_LEVEL_6 = 0x2000,
  246.     DVD_PARENTAL_LEVEL_5 = 0x1000,
  247.     DVD_PARENTAL_LEVEL_4 = 0x0800,
  248.     DVD_PARENTAL_LEVEL_3 = 0x0400,
  249.     DVD_PARENTAL_LEVEL_2 = 0x0200,
  250.     DVD_PARENTAL_LEVEL_1 = 0x0100
  251. } DVD_PARENTAL_LEVEL;
  252.  
  253.  
  254. typedef enum tagDVD_AUDIO_LANG_EXT
  255. {
  256.     DVD_AUD_EXT_NotSpecified        =0,
  257.     DVD_AUD_EXT_Captions            =1,
  258.     DVD_AUD_EXT_VisuallyImpaired    =2,
  259.     DVD_AUD_EXT_DirectorComments1   =3,
  260.     DVD_AUD_EXT_DirectorComments2   =4,
  261. } DVD_AUDIO_LANG_EXT;
  262.  
  263. typedef enum tagDVD_SUBPICTURE_LANG_EXT
  264. {
  265.     DVD_SP_EXT_NotSpecified     =0,
  266.     DVD_SP_EXT_Caption_Normal   =1,
  267.     DVD_SP_EXT_Caption_Big      =2,
  268.     DVD_SP_EXT_Caption_Children =3,
  269.     DVD_SP_EXT_CC_Normal        =5,
  270.     DVD_SP_EXT_CC_Big           =6,
  271.     DVD_SP_EXT_CC_Children      =7,
  272.     DVD_SP_EXT_Forced           =9,
  273.     DVD_SP_EXT_DirectorComments_Normal      =13,
  274.     DVD_SP_EXT_DirectorComments_Big         =14,
  275.     DVD_SP_EXT_DirectorComments_Children    =15,
  276. } DVD_SUBPICTURE_LANG_EXT;
  277.  
  278. typedef enum tagDVD_AUDIO_APPMODE
  279. {
  280.     DVD_AudioMode_None     = 0, // no special mode
  281.     DVD_AudioMode_Karaoke  = 1,
  282.     DVD_AudioMode_Surround = 2, 
  283.     DVD_AudioMode_Other    = 3, 
  284. } DVD_AUDIO_APPMODE;
  285.  
  286. typedef enum tagDVD_AUDIO_FORMAT
  287. {
  288.     DVD_AudioFormat_AC3       = 0,
  289.     DVD_AudioFormat_MPEG1     = 1,
  290.     DVD_AudioFormat_MPEG1_DRC = 2,    // MPEG1 with dynamic range control
  291.     DVD_AudioFormat_MPEG2     = 3,
  292.     DVD_AudioFormat_MPEG2_DRC = 4,    // MPEG2 with dynamic range control
  293.     DVD_AudioFormat_LPCM      = 5,
  294.     DVD_AudioFormat_DTS       = 6,
  295.     DVD_AudioFormat_SDDS      = 7,
  296.     DVD_AudioFormat_Other     = 8
  297. } DVD_AUDIO_FORMAT;
  298.  
  299. // flags for SelectKaraokeAudioPresentationMode
  300. typedef enum tagDVD_KARAOKE_DOWNMIX
  301. {
  302.     DVD_Mix_0to0 = 0x0001,  // unused - reserved for future use
  303.     DVD_Mix_1to0 = 0x0002,  // unused - reserved for future use
  304.     DVD_Mix_2to0 = 0x0004,
  305.     DVD_Mix_3to0 = 0x0008,
  306.     DVD_Mix_4to0 = 0x0010,
  307.     DVD_Mix_Lto0 = 0x0020,  // mix auxillary L to channel 0 (left speaker)
  308.     DVD_Mix_Rto0 = 0x0040,  // mix auxillary R to channel 0 (left speaker)
  309.  
  310.     DVD_Mix_0to1 = 0x0100,  // unused - reserved for future use
  311.     DVD_Mix_1to1 = 0x0200,  // unused - reserved for future use
  312.     DVD_Mix_2to1 = 0x0400,
  313.     DVD_Mix_3to1 = 0x0800,
  314.     DVD_Mix_4to1 = 0x1000,
  315.     DVD_Mix_Lto1 = 0x2000,  // mix auxillary L to channel 1 (right speaker)
  316.     DVD_Mix_Rto1 = 0x4000,  // mix auxillary R to channel 1 (right speaker)
  317. } DVD_KARAOKE_DOWNMIX;
  318.  
  319.  
  320. typedef struct tagDVD_AudioAttributes
  321. {
  322.     DVD_AUDIO_APPMODE   AppMode;
  323.     BYTE                AppModeData;            
  324.     DVD_AUDIO_FORMAT    AudioFormat;            // Use GetKaraokeAttributes()
  325.     LCID                Language;               // 0 if no language is present
  326.     DVD_AUDIO_LANG_EXT  LanguageExtension;      // (captions, if for children etc)
  327.     BOOL                fHasMultichannelInfo;   // multichannel attributes are present (Use GetMultiChannelAudioAttributes())
  328.     DWORD               dwFrequency;            // in hertz (48k, 96k)
  329.     BYTE                bQuantization;          // resolution (16, 20, 24 bits etc), 0 is unknown
  330.     BYTE                bNumberOfChannels;      // 5.1 AC3 has 6 channels
  331.     DWORD               dwReserved[2];
  332. } DVD_AudioAttributes;
  333.  
  334. typedef struct tagDVD_MUA_MixingInfo
  335. {   
  336.     // surround sound mixing information applied when:
  337.     // AppMode = DVD_AudioMode_Surround
  338.     // AudioFormat = DVD_AudioFormat_LPCM,
  339.     // fHasMultichannelInfo=1 modes are all on
  340.     //
  341.     BOOL    fMixTo0;
  342.     BOOL    fMixTo1;
  343.  
  344.     //
  345.     BOOL    fMix0InPhase;
  346.     BOOL    fMix1InPhase;
  347.  
  348.     DWORD   dwSpeakerPosition;  // see ksmedia.h: SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT, etc
  349. } DVD_MUA_MixingInfo;
  350.  
  351. //  The alpha coeff is used to mix to ACH0 and beta is used to mix to ACH1
  352. //
  353. //  In general:
  354. //      ACH0 = coeff[0].alpha * value[0] + coeff[1].alpha * value[1] + ... 
  355. //      ACH1 = coeff[0].beta * value[0]  + coeff[1].beta * value[1] + ... 
  356. typedef struct tagDVD_MUA_Coeff
  357. {
  358.     double   log2_alpha; // actual coeff = 2^alpha
  359.     double   log2_beta;  // actual coeff = 2^beta
  360. } DVD_MUA_Coeff;
  361.  
  362. typedef struct tagDVD_MultichannelAudioAttributes
  363. {
  364.     // actual Data for each data stream
  365.     DVD_MUA_MixingInfo  Info[8];
  366.     DVD_MUA_Coeff       Coeff[8];
  367. } DVD_MultichannelAudioAttributes;
  368.  
  369. // bitwise OR of these flags descript the contents of each channel
  370. typedef enum tagDVD_KARAOKE_CONTENTS
  371. {
  372.     DVD_Karaoke_GuideVocal1  = 0x0001,
  373.     DVD_Karaoke_GuideVocal2  = 0x0002,
  374.     DVD_Karaoke_GuideMelody1 = 0x0004,
  375.     DVD_Karaoke_GuideMelody2 = 0x0008,
  376.     DVD_Karaoke_GuideMelodyA = 0x0010,
  377.     DVD_Karaoke_GuideMelodyB = 0x0020,
  378.     DVD_Karaoke_SoundEffectA = 0x0040,
  379.     DVD_Karaoke_SoundEffectB = 0x0080
  380. } DVD_KARAOKE_CONTENTS;
  381.  
  382. typedef enum tagDVD_KARAOKE_ASSIGNMENT
  383. {
  384.     DVD_Assignment_reserved0   = 0,
  385.     DVD_Assignment_reserved1   = 1,
  386.     DVD_Assignment_LR    = 2,   // left right
  387.     DVD_Assignment_LRM   = 3,   // left right middle
  388.     DVD_Assignment_LR1   = 4,   // left right audio1
  389.     DVD_Assignment_LRM1  = 5,   // left right middle audio1
  390.     DVD_Assignment_LR12  = 6,   // left right audio1 audio2
  391.     DVD_Assignment_LRM12 = 7        // left right middle audio1 audio2
  392. } DVD_KARAOKE_ASSIGNMENT;
  393.  
  394. typedef struct tagDVD_KaraokeAttributes
  395. {
  396.     BYTE            bVersion;
  397.     BOOL            fMasterOfCeremoniesInGuideVocal1;
  398.     BOOL            fDuet;  // false = solo
  399.     DVD_KARAOKE_ASSIGNMENT  ChannelAssignment;
  400.     WORD            wChannelContents[8];        // logical OR of DVD_KARAOKE_CONTENTS  
  401. } DVD_KaraokeAttributes;
  402.  
  403. typedef enum tagDVD_VIDEO_COMPRESSION
  404. {
  405.     DVD_VideoCompression_Other  = 0,
  406.     DVD_VideoCompression_MPEG1  = 1,
  407.     DVD_VideoCompression_MPEG2  = 2,
  408. } DVD_VIDEO_COMPRESSION;
  409.  
  410. typedef struct tagDVD_VideoAttributes
  411. {
  412.     BOOL        fPanscanPermitted;      // if a 4x3 display, can be shown as PanScan
  413.     BOOL        fLetterboxPermitted;    // if a 4x3 display, can be shown as Letterbox
  414.     ULONG       ulAspectX;              // 4x3 or 16x9
  415.     ULONG       ulAspectY;
  416.     ULONG       ulFrameRate;            // 50hz or 60hz
  417.     ULONG       ulFrameHeight;          // 525 (60hz) or 625 (50hz)
  418.     DVD_VIDEO_COMPRESSION   Compression;// MPEG1 or MPEG2
  419.  
  420.     BOOL        fLine21Field1InGOP;     // true if there is user data in field 1 of GOP of video stream
  421.     BOOL        fLine21Field2InGOP;     // true if there is user data in field 1 of GOP of video stream
  422.  
  423.     ULONG       ulSourceResolutionX;    // X source resolution (352,704, or 720)
  424.     ULONG       ulSourceResolutionY;    // Y source resolution (240,480, 288 or 576)
  425.  
  426.     BOOL        fIsSourceLetterboxed;   // subpictures and highlights (e.g. subtitles or menu buttons) are only
  427.                                         // displayed in the active video area and cannot be displayed in the top/bottom 'black' bars
  428.     BOOL        fIsFilmMode;          // for 625/50hz systems, is film mode (true) or camera mode (false) 
  429. } DVD_VideoAttributes;
  430.  
  431. typedef enum tagDVD_SUBPICTURE_TYPE
  432. {
  433.     DVD_SPType_NotSpecified = 0,
  434.     DVD_SPType_Language     = 1,
  435.     DVD_SPType_Other        = 2,
  436. } DVD_SUBPICTURE_TYPE;
  437.  
  438. typedef enum tagDVD_SUBPICTURE_CODING
  439. {
  440.     DVD_SPCoding_RunLength    = 0,
  441.     DVD_SPCoding_Extended     = 1,
  442.     DVD_SPCoding_Other        = 2,
  443. } DVD_SUBPICTURE_CODING;
  444.  
  445. typedef struct tagDVD_SubpictureAttributes
  446. {
  447.     DVD_SUBPICTURE_TYPE     Type;
  448.     DVD_SUBPICTURE_CODING   CodingMode;
  449.     LCID                    Language;
  450.     DVD_SUBPICTURE_LANG_EXT LanguageExtension;
  451. } DVD_SubpictureAttributes;
  452.  
  453. typedef enum tagDVD_TITLE_APPMODE
  454. {
  455.     DVD_AppMode_Not_Specified = 0, // no special mode
  456.     DVD_AppMode_Karaoke  = 1,
  457.     DVD_AppMode_Other    = 3, 
  458. } DVD_TITLE_APPMODE;
  459.  
  460. typedef struct tagDVD_TitleMainAttributes 
  461. {
  462.     // for Titles
  463.     DVD_TITLE_APPMODE           AppMode;
  464.  
  465.     // Attributes about the 'main' video of the menu or title
  466.     DVD_VideoAttributes         VideoAttributes;
  467.  
  468.     ULONG                       ulNumberOfAudioStreams;
  469.     DVD_AudioAttributes         AudioAttributes[8];
  470.     // present if the multichannel bit is set in the corresponding stream's audio attributes
  471.     DVD_MultichannelAudioAttributes     MultichannelAudioAttributes[8];
  472.  
  473.     ULONG                       ulNumberOfSubpictureStreams;
  474.     DVD_SubpictureAttributes    SubpictureAttributes[32];
  475. } DVD_TitleAttributes;
  476.  
  477. typedef struct tagDVD_MenuAttributes 
  478. {
  479.     // for VMG only 
  480.     BOOL                        fCompatibleRegion[8];  // indeces 0..7 correspond to regions 1..8
  481.  
  482.     // Attributes about the main menu (VMGM or VTSM)
  483.     DVD_VideoAttributes         VideoAttributes;
  484.  
  485.     BOOL                        fAudioPresent;
  486.     DVD_AudioAttributes         AudioAttributes;
  487.  
  488.     BOOL                        fSubpicturePresent;
  489.     DVD_SubpictureAttributes    SubpictureAttributes;
  490. } DVD_MenuAttributes;
  491.  
  492. //==========================================================================
  493. //==========================================================================
  494. // IDvdControl interface -- Basic DVD-Video playback control.
  495. // This modeled after the app control of a player specified in Annex J 
  496. // of the DVD Video spec.  IDvdInfo can be used to get information useful
  497. // in using IDvdControl
  498. //==========================================================================
  499. //==========================================================================
  500.  
  501. [
  502. object,
  503. uuid(A70EFE61-E2A3-11d0-A9BE-00AA0061BE93),
  504. pointer_default(unique)
  505. ]
  506.  
  507. interface IDvdControl : IUnknown {
  508.     import "unknwn.idl";
  509.     
  510.     // TitlePlay 
  511.     // Start playing the specified title number. 
  512.     // Title numbers range between 1 and 99.
  513.     HRESULT TitlePlay
  514.     ( [in]  ULONG   ulTitle
  515.     );
  516.  
  517.     // ChapterPlay
  518.     // Start playing at the specified chapter (or part-of-title) 
  519.     // within the specified title.  Chapters range from 1 to 999.
  520.     HRESULT ChapterPlay
  521.     ( [in]  ULONG   ulTitle, 
  522.       [in]  ULONG   ulChapter
  523.     );
  524.  
  525.     // TimePlay
  526.     // Start playing at the specified time within the specified title.
  527.     // NOTE: the actual start time will be the closest sync point before
  528.     // or equal to the specified frame number.
  529.     HRESULT TimePlay
  530.     ( [in]  ULONG   ulTitle,
  531.       [in]  ULONG   bcdTime  // use DVD_TIMECODE.  Framerate code is ignored.
  532.     );
  533.  
  534.     // StopForResume
  535.     // Stop playback after saving resume information.  DVD Navigator transfers to the DVD "Stop State" and 
  536.     // (same as DVD_DOMAIN_Stop), but filter graph remains in DirectShow's Run state.
  537.     HRESULT StopForResume();     
  538.  
  539.     // GoUp
  540.     // Start playback of the program chain currently authored as the "GoUp_PGCN".
  541.     HRESULT GoUp();     
  542.  
  543.     // TimeSearch
  544.     // Start playing at the specified time within the current title.
  545.     // NOTE: the actual start time will be the closest sync point before
  546.     // or equal to the specified frame number.
  547.     HRESULT TimeSearch
  548.     ( [in]  ULONG   bcdTime  // use DVD_TIMECODE.  Framerate code is ignored.
  549.     );      
  550.  
  551.     // ChapterSearch
  552.     // Start playing at the specified chapter (or part-of-title) within
  553.     // the current title.
  554.     HRESULT ChapterSearch
  555.     ( [in]  ULONG   ulChapter
  556.     );      
  557.  
  558.     // PrevPGSearch
  559.     // Start playing at the beginning of the previous DVD "program".
  560.     // For One-Sequential_PGC_Titles (which includes most titles) a program 
  561.     // is equivalent to a chapter, otherwise a program is part of a chapter. 
  562.     HRESULT PrevPGSearch();     
  563.  
  564.     // TopPGSearch
  565.     // Start playing from the beginning of they current program.
  566.     HRESULT TopPGSearch();      
  567.  
  568.     // NextPGSearch
  569.     // Start playing from the beginning of the next program.
  570.     HRESULT NextPGSearch();     
  571.  
  572.     // ForwardScan
  573.     // Set forward play at the specified speed.  
  574.     //      dwSpeed == 1 is normal play
  575.     //      dwSpeed  < 1 is slow play
  576.     //      dwSpeed  > 1 is fast play
  577.     // For dwSpeed != 1, audio and subpicture is muted.
  578.     HRESULT ForwardScan
  579.     ( [in]  double  dwSpeed
  580.     );      
  581.  
  582.     // BackwardScan
  583.     // Set reverse play at the specified speed.  
  584.     //      dwSpeed == 1 is normal play speed in reverse
  585.     //      dwSpeed  < 1 is slow play in reverse
  586.     //      dwSpeed  > 1 is fast play in reverse
  587.     // For reverse play, audio and subpicture are always muted.
  588.     HRESULT BackwardScan
  589.     ( [in]  double  dwSpeed
  590.     );      
  591.  
  592.     // MenuCall
  593.     // Start playback of the Menu specified by an enum DVD_MENU_ID.
  594.     HRESULT MenuCall
  595.     ( [in]  DVD_MENU_ID   MenuID  
  596.     );      
  597.  
  598.     // Resume
  599.     // Returns to title playback in DVD_DOMAIN_Title. This is typically
  600.     // done after MenuCall which puts the DVD Navigator in 
  601.     // DVD_DOMAIN_VideoTitleSetMenu or DVD_DOMAIN_VideoManagerMenu.
  602.     HRESULT Resume();       
  603.  
  604.     // UpperButtonSelect
  605.     // Selects the button above the current button.
  606.     // "Selecting" a DVD button simply highlights the button but does
  607.     // not "Activate" the button.  Selecting is the Windows equivalent 
  608.     // to tabbing to a button but not pressing the space bar or enter key.
  609.     // Activating is the Windows equivalent of pressing the space bar or
  610.     // enter key after tabbing to a button.
  611.     HRESULT UpperButtonSelect();        
  612.  
  613.     // LowerButtonSelect
  614.     // Selects the button below the current button.
  615.     HRESULT LowerButtonSelect();        
  616.  
  617.     // LeftButtonSelect
  618.     // Selects the button to the left of the current button.
  619.     HRESULT LeftButtonSelect();     
  620.  
  621.     // RightButtonSelect
  622.     // Selects the button to the right of the current button.
  623.     HRESULT RightButtonSelect();        
  624.  
  625.     // ButtonActivate
  626.     // Activates current button.
  627.     HRESULT ButtonActivate();       
  628.  
  629.     // ButtonSelectAndActivate
  630.     // Selects and then activates the button specified by the user.  
  631.     // ulButton is intended to be a number entered by a user corresponding
  632.     // to button numbers currently displayed on screen.  
  633.     // Button numbers range from 1 to 36.
  634.     HRESULT ButtonSelectAndActivate
  635.     ( [in]  ULONG   ulButton
  636.     );      
  637.  
  638.     // StillOff
  639.     // Releases any current still if there are no available buttons.
  640.     // This includes VOBU stills, Cell stills, and PGC stills, whether the 
  641.     // still is infinite.  When buttons are available, stills are released by
  642.     // activating a button.  Note this does not release a Pause.
  643.     HRESULT StillOff();     
  644.  
  645.     // PauseOn
  646.     // Freezes playback and any internal timers. This is similar to
  647.     // IMediaControl::Pause()
  648.     HRESULT PauseOn();      
  649.  
  650.     // PauseOff
  651.     // Releases a Pause.  
  652.     HRESULT PauseOff();     
  653.  
  654.     // MenuLanguageSelect
  655.     // Selects the default language for menus.  Languages are specified with
  656.     // Windows standard LCIDs.  LCIDs can be created from ISO-639 codes with
  657.     // MAKELCID( MAKELANGID(wISO639LangID ,SUBLANG_DEFAULT ), SORT_DEFAULT )
  658.     // NOTE: MAKELANGID seems to have a bug so 'jp' may have to be used 
  659.     // instead of 'ja' for the ISO639 code for Japanese.
  660.     // MenuLanguageSelect may only called from the DVD Stop state (DVD_DOMAIN_Stop).
  661.     HRESULT MenuLanguageSelect
  662.     ( [in]  LCID    Language
  663.     );      
  664.  
  665.     // AudioStreamChange
  666.     // Changes the current audio stream.
  667.     HRESULT AudioStreamChange
  668.     ( [in]  ULONG   ulAudio
  669.     );      
  670.  
  671.     // SubpictureStreamChange
  672.     // Changes the current subpicture stream number to nSubpic, and toggles 
  673.     // its display.
  674.     HRESULT SubpictureStreamChange
  675.     ( [in]  ULONG   ulSubPicture,
  676.       [in]  BOOL    bDisplay
  677.     );      
  678.  
  679.     // AngleChange
  680.     // Changes the current angle number.
  681.     HRESULT AngleChange
  682.     ( [in]  ULONG   ulAngle
  683.     );      
  684.  
  685.     // ParentalLevelSelect
  686.     // Selects the current player parental level between 1 and 8.  The
  687.     // defined parental levels are listed below :
  688.     //
  689.     //      Level   Rating  
  690.     //      -----   ------  
  691.     //
  692.     //      1       G       
  693.     //      3       PG      
  694.     //      4       PG13    
  695.     //      6       R       
  696.     //      7       NC17    
  697.     // Higher levels can play lower level content; lower levels cannot play 
  698.     // higher level content.  The DVD Navigator provides no restriction on
  699.     // setting the parental level.  DVD player application may enforce 
  700.     // restriction on parental level setting, such as password protection for 
  701.     // raising the current parental level.  Parental Management is disabled in
  702.     // the Navigator by default.
  703.     //
  704.     //      Note : To disable parental management, pass 0xffffffff for ulParentalLevel
  705.     //                 If parental management is disabled, then the player will play the
  706.     //                 first PGC in a parental block regardless of parental IDs.
  707.     //
  708.     HRESULT ParentalLevelSelect
  709.     ( [in]  ULONG   ulParentalLevel  
  710.     );      
  711.  
  712.     // ParentalCountrySelect
  713.     // Sets the country in which to interpret the the Parental Level.
  714.     // The country specified using the Alpha-2 code of the ISO-3166 standard,
  715.     // with the addition of 'ZZ' 
  716.     HRESULT ParentalCountrySelect
  717.     ( [in]  WORD    wCountry
  718.     );      
  719.  
  720.     // KaraokeAudioPresentationModeChange
  721.     // Sets the Karaoke audio mode.  
  722.     // NOTE: This and all other Karoke support is currently not implemented.
  723.     HRESULT KaraokeAudioPresentationModeChange
  724.     ( [in] ULONG    ulMode
  725.     );      
  726.  
  727.     // VideoModePreferrence
  728.     // The user can specify the preferred display mode that should
  729.     // be used to display content. The parameter is a ULONG that has
  730.     // one of the values defined in DVD_PREFERRED_DISPLAY_MODE
  731.     HRESULT VideoModePreferrence
  732.     ( [in]  ULONG    ulPreferredDisplayMode
  733.     );
  734.     
  735.     // SetRoot
  736.     // Sets the root directory containing the DVD-Video volume. 
  737.     // Can only be called from the DVD Stop State (DVD_DOMAIN_Stop).
  738.     // If the root directory is not successfully set before 
  739.     // IMediaControl::Play is called, the first drive starting from c:
  740.     // containing a VIDEO_TS directory in the top level directory
  741.     // will be used as the root.
  742.     HRESULT SetRoot
  743.     ( [in]  LPCWSTR     pszPath
  744.     );        
  745.  
  746.     // MouseActivate
  747.     // This is typically called in response to a mouse click.
  748.     // The specified point within the display window is to see if it is
  749.     // within a current DVD button's highlight rect.  If it is, that 
  750.     // button is first selected, then activated.  
  751.     // NOTE: DVD Buttons do not all necessarily have highlight rects,
  752.     // button rects can overlap, and button rects do not always
  753.     // correspond to the visual representation of DVD buttons.
  754.     HRESULT MouseActivate       // typically called after a mouse click
  755.     ( [in]  POINT       point
  756.     );
  757.  
  758.     // MouseSelect
  759.     // This is typically called in response to a mouse move within the 
  760.     // display window.
  761.     // The specified point within the display window is to see if it is
  762.     // within a current DVD button's highlight rect.  If it is, that 
  763.     // button is selected.
  764.     // NOTE: DVD Buttons do not all necessarily have highlight rects,
  765.     // button rects can overlap, and button rects do not always
  766.     // correspond to the visual representation of DVD buttons.
  767.     HRESULT MouseSelect         // typically called after a mouse move
  768.     ( [in]  POINT       point
  769.     );
  770.     
  771.     // ChapterPlayAutoStop
  772.     // Start playing at the specified chapter within the specified title
  773.     // and play the number of chapters specified by the third parameter.
  774.     // Chapters range from 1 to 999.
  775.     HRESULT ChapterPlayAutoStop
  776.     ( [in] ULONG ulTitle,           // title number
  777.       [in] ULONG ulChapter,         // chapter number to start playback
  778.       [in] ULONG ulChaptersToPlay   // number of chapters to play from the start chapter
  779.     );
  780. }
  781.  
  782.  
  783.  
  784. //==========================================================================
  785. //==========================================================================
  786. // IDvdInfo interface -- allow an app to query for attributes of available 
  787. // DVD titles and DVD player status.  Also allow for control of a DVD 
  788. // player beyond Annex J in the DVD spec.
  789. //==========================================================================
  790. //==========================================================================
  791.  
  792. [
  793. object,
  794. uuid(A70EFE60-E2A3-11d0-A9BE-00AA0061BE93),
  795. pointer_default(unique)
  796. ]
  797.  
  798. interface IDvdInfo : IUnknown {
  799.     import "unknwn.idl";
  800.  
  801.     // GetCurrentDomain
  802.     // Returns the current DVD Domain of the DVD player.
  803.     HRESULT GetCurrentDomain
  804.     ( [out] DVD_DOMAIN *pDomain 
  805.     );
  806.  
  807.     // GetCurrentLocation
  808.     // Returns information sufficient to restart playback of a video
  809.     // from the current playback location in titles that don't explicitly
  810.     // disable seeking to the current location.
  811.     HRESULT GetCurrentLocation
  812.     ( [out] DVD_PLAYBACK_LOCATION *pLocation
  813.     );
  814.  
  815.     // GetTotalTitleTime
  816.     // Return the total playback time for the current title.  Only works
  817.     // for One_Sequential_PGC_Titles.
  818.     HRESULT GetTotalTitleTime
  819.     ( [out] ULONG * pulTotalTime // use DVD_TIMECODE.
  820.     );
  821.  
  822.     // GetCurrentButton
  823.     // Indicates the number of currently available buttons and the current
  824.     // selected button number. If buttons are not present it returns 0 for
  825.     // both pulButtonsAvailable and pulCurrentButton
  826.     HRESULT GetCurrentButton
  827.     ( [out] ULONG *    pulButtonsAvailable,
  828.       [out] ULONG *    pulCurrentButton
  829.     );
  830.  
  831.     // GetCurrentAngle
  832.     // Indicates the number of currently available angles and the current
  833.     // selected angle number.  If *pnAnglesAvailable==1, then the current
  834.     // video is not multiangle.
  835.     HRESULT GetCurrentAngle
  836.     ( [out] ULONG *    pulAnglesAvailable,
  837.       [out] ULONG *    pulCurrentAngle
  838.     );
  839.  
  840.     // GetCurrentAudio
  841.     // Indicates the number of currently available audio streams and 
  842.     // the current selected audio stream number.
  843.     // This only work when in DVD_DOMAIN_Title.
  844.     HRESULT GetCurrentAudio
  845.     ( [out] ULONG *    pulStreamsAvailable,
  846.       [out] ULONG *    pulCurrentStream
  847.     );
  848.  
  849.     // GetCurrentSubpicture
  850.     // Indicates the number of currently available subpicture streams,
  851.     // the current selected subpicture stream number, and if the 
  852.     // subpicture display is currently disabled.  Subpicture streams 
  853.     // authored as Forcedly Activated stream will be displayed even if
  854.     // subpicture display has been disabled by the app with 
  855.     // IDVDControl::SubpictureChangeStream.
  856.     // This only work when in DVD_DOMAIN_Title.
  857.     HRESULT GetCurrentSubpicture
  858.     ( [out] ULONG *    pulStreamsAvailable,
  859.       [out] ULONG *    pulCurrentStream,
  860.       [out] BOOL *     pIsDisabled
  861.     );
  862.  
  863.     // GetCurrentUOPS
  864.     // Indicates which IDVDControl methods are currently valid.  DVD titles
  865.     // can enable or disable individual user operations at almost any point 
  866.     // during playback.
  867.     HRESULT GetCurrentUOPS  
  868.     ( [out] VALID_UOP_SOMTHING_OR_OTHER *    pUOP
  869.     );
  870.  
  871.     // GetAllSPRMs
  872.     // Returns the current contents of all System Parameter Registers.
  873.     // See DVD-Video spec for use of individual registers.
  874.     HRESULT GetAllSPRMs
  875.     ( [out] SPRMARRAY * pRegisterArray
  876.     );
  877.  
  878.     // GetAllGPRMs
  879.     // Returns the current contents of all General Parameter Registers.
  880.     // Use of GPRMs is title specific. 
  881.     HRESULT GetAllGPRMs
  882.     ( [out] GPRMARRAY * pRegisterArray
  883.     );
  884.  
  885.     // GetAudioLanguage
  886.     // Returns the language of the specified stream within the current
  887.     // title.  Does not return languages for menus.  Sets *pLanguage=0 if
  888.     // if the stream does not include language.
  889.     // Use GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize)
  890.     // to create a human readable string name from the result LCID.
  891.     HRESULT GetAudioLanguage
  892.     ( [in]  ULONG        ulStream, 
  893.       [out] LCID *       pLanguage
  894.     );
  895.  
  896.     // GetSubpictureLanguage
  897.     // Returns the language of the specified stream within the current
  898.     // title.  Does not return languages for menus.  Sets *pLanguage=0 if
  899.     // if the stream does not include language.
  900.     // Use GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize)
  901.     // to create a human readable string name from the result LCID.
  902.     HRESULT GetSubpictureLanguage
  903.     ( [in]  ULONG        ulStream, 
  904.       [out] LCID *       pLanguage
  905.     );
  906.  
  907.     // GetTitleAttributes
  908.     // Returns attributes of all video, audio, and subpicture 
  909.     // streams for the specified title including menus.  
  910.     // If nTitle == 0xffffffff, attributes for the current title are returned.
  911.     HRESULT GetTitleAttributes
  912.     ( [in]  ULONG       ulTitle, // requested title number
  913.       [out] DVD_ATR *   pATR 
  914.     );
  915.  
  916.     // GetVMGAttributes
  917.     // Returns attributes of all video, audio, and subpicture 
  918.     // streams for Video Manager Menus.  Some menus, such as the DVD_MENU_Title
  919.     // are in a separate group of streams called the VMG (Video Manager) and
  920.     // are not associated with any particular title number.
  921.     HRESULT GetVMGAttributes
  922.     ( [out] DVD_ATR *   pATR 
  923.     );
  924.  
  925.     // GetCurrentVideoAttributes
  926.     // Returns the video attributes for the current title or menu.
  927.     HRESULT GetCurrentVideoAttributes
  928.     ( [out] DVD_VideoATR *pATR 
  929.     );
  930.  
  931.     // GetCurrentAudioAttributes
  932.     // Returns the video attributes for the stream in the current 
  933.     // title or menu.
  934.     HRESULT GetCurrentAudioAttributes
  935.     ( [out] DVD_AudioATR *pATR 
  936.     );
  937.  
  938.     // GetCurrentSubpictureAttributes
  939.     // Returns the video attributes for the stream in the current 
  940.     // title or menu.
  941.     HRESULT GetCurrentSubpictureAttributes
  942.     ( [out] DVD_SubpictureATR *pATR 
  943.     );
  944.  
  945.  
  946.     // GetCurrentVolumeInfo
  947.     // Returns current DVD volume info.
  948.     HRESULT GetCurrentVolumeInfo
  949.     ( [out] ULONG *pulNumOfVol,   // number of volumes (disc sides?) in a volume set
  950.       [out] ULONG *pulThisVolNum, // volume number for this root directory
  951.       [out] DVD_DISC_SIDE *pSide, // current disc side
  952.       [out] ULONG *pulNumOfTitles // number of titles available in this volume
  953.     );
  954.  
  955.  
  956.     // GetDVDTextInfo
  957.     // Returns the TXTDT_MG structure, which can contain text descriptions for title
  958.     // name, volume name, producer name, vocalist name, etc. in various languages.
  959.     // refer to Section 4.1.6 and Annex A of the DVD-Video spec.
  960.     // If the buffer size passed in is insufficient (for example if cbBufSize==0),
  961.     // then E_OUTOFMEMORY is returned, and *pcbActualSize is set to the required size.
  962.     HRESULT GetDVDTextInfo
  963.     ( [out, size_is(ulBufSize)] BYTE *pTextManager, 
  964.       [in]  ULONG ulBufSize,        // buffer size passed in
  965.       [out] ULONG *pulActualSize    // amount of actual data return
  966.     );
  967.  
  968.     //  GetPlayerParentalLevel
  969.     //  Returns the current parental level and the current country code
  970.     //  that has been set in the system registers in player. 
  971.     //  See Table 3.3.4-1 of the DVD-Video spec for the defined parental levels.
  972.     //  Valid Parental Levels = 1..8 if parental management is enabled
  973.     //  0xffffffff if parental management is disabled
  974.     //  See ISO3166 : Alpha-2 Code for the country codes.
  975.     HRESULT GetPlayerParentalLevel
  976.     ( [out] ULONG *pulParentalLevel,    // current parental level
  977.       [out] ULONG *pulCountryCode       // current country code
  978.     );
  979.     
  980.     //  GetNumberOfChapters
  981.     //  Returns the number of chapters that are defined for a
  982.     //  given title.
  983.     HRESULT GetNumberOfChapters
  984.     ( [in]  ULONG ulTitle,              // Title for which number of chapters is requested
  985.       [out] ULONG *pulNumberOfChapters    // Number of chapters for the specified title
  986.     );
  987.  
  988.     // GetTitleParentalLevels
  989.     // Returns the parental levels that are defined for a
  990.     // particular title. pParentalLevels will be combination
  991.     // of DVD_PARENTAL_LEVEL_8, DVD_PARENTAL_LEVEL_6, or 
  992.     // DVD_PARENTAL_LEVEL_1 "OR"ed together
  993.     HRESULT GetTitleParentalLevels
  994.     ( [in] ULONG ulTitle,           // Title for which parental levels are requested
  995.       [out] ULONG *pulParentalLevels  // Parental levels defined for the title "OR"ed together
  996.     );
  997.  
  998.     // GetRoot
  999.     // Returns the root directory that is set in the player. If a valid root
  1000.     // has been found, it returns the root string. Otherwise, it returns 0 for
  1001.     // pcbActualSize indicating that a valid root directory has not been found
  1002.     // or initialized.
  1003.     //
  1004.     // !!! used to return LPTSTR. interface was changed to return
  1005.     // LPSTR (ansi) for compatibility. COM APIs should pass with
  1006.     // UNICODE strings only.
  1007.     // 
  1008.     HRESULT GetRoot
  1009.     ( [out, size_is(ulBufSize)] LPSTR pRoot,    // pointer to buffer to get root string
  1010.       [in]  ULONG ulBufSize,                    // size of buffer passed in
  1011.       [out] ULONG *pulActualSize                // size of actual data returned
  1012.     );
  1013. }
  1014.  
  1015. //==========================================================================
  1016. //==========================================================================
  1017. // IDvdCmd interface -- the IDVDControl2 command sequencing object.
  1018. //
  1019. // For the IDVDControl2 interface, the application can track the status of
  1020. // commands that have been issued to the navigator.  Each command is identified
  1021. // by an IDvdCmd object.  The IDvdCmd object stores the results of the command
  1022. // at both the start (when the command has begun processing) and the end after
  1023. // it has completed.  It also allows the app to synchronize with the processing
  1024. // of the command.
  1025. //
  1026. //  The command object also allows the app to uniquely identify and correlate
  1027. // completion events (if it prefers to process events in a message loop instead
  1028. // of creating another process).
  1029. //
  1030. //     Allows the app to track the status of an issued command to the nav.
  1031. //==========================================================================
  1032. //==========================================================================
  1033.  
  1034. [
  1035. object,
  1036. uuid(5a4a97e4-94ee-4a55-9751-74b5643aa27d),
  1037. pointer_default(unique)
  1038. ]
  1039.  
  1040. interface IDvdCmd : IUnknown {
  1041.     import "unknwn.idl";
  1042.  
  1043.     //
  1044.     // WaitForStart
  1045.     //
  1046.     // Blocks the application until the command has begun.
  1047.     //
  1048.     HRESULT WaitForStart();
  1049.  
  1050.     //
  1051.     // WaitForEnd
  1052.     //
  1053.     // Blocks until the command has completed or has been cancelled.
  1054.     HRESULT WaitForEnd();
  1055. }
  1056.  
  1057. //==========================================================================
  1058. //==========================================================================
  1059. // IDvdState interface -- the State state object.
  1060. //
  1061. // Whenever the application wishes to save or restore a location on the disc,
  1062. // it needs to store the DVD state into an object.
  1063. // The State object supports the IPersistStream  
  1064. //
  1065. //==========================================================================
  1066. //==========================================================================
  1067.  
  1068. [
  1069. object,
  1070. uuid(86303d6d-1c4a-4087-ab42-f711167048ef),
  1071. pointer_default(unique)
  1072. ]
  1073.  
  1074. interface IDvdState : IUnknown
  1075. {
  1076.     //
  1077.     // GetDiscID
  1078.     //
  1079.     // Returns the disc ID from which the bookmark was made.
  1080.     //
  1081.     HRESULT GetDiscID
  1082.     ( [out] ULONGLONG* pullUniqueID ); // 64-bit unique id for the disc
  1083.  
  1084.     //
  1085.     // GetParentalLevel
  1086.     //
  1087.     // Returns the state's parental level
  1088.     //
  1089.     HRESULT GetParentalLevel
  1090.     ( [out] ULONG* pulParentalLevel );
  1091. }
  1092.  
  1093. //==========================================================================
  1094. //==========================================================================
  1095. // IDvdControl2 interface -- Basic DVD-Video playback control.
  1096. // This is modeled after the app control of a player specified in Annex J 
  1097. // of the DVD Video spec.  IDvdInfo2 can be used to get information useful
  1098. // in using IDvdControl2
  1099. //==========================================================================
  1100. //==========================================================================
  1101.  
  1102. [
  1103. object,
  1104. uuid(33BC7430-EEC0-11D2-8201-00A0C9D74842),
  1105. pointer_default(unique)
  1106. ]
  1107.  
  1108. interface IDvdControl2 : IUnknown {
  1109.     import "unknwn.idl";
  1110.     
  1111.     // PlayTitle
  1112.     //
  1113.     // Start playing from the beginning of the specified title number.
  1114.     // Annex J: Title_Play
  1115.     // Title numbers range between 1 and 99.
  1116.     HRESULT PlayTitle
  1117.     ( [in]  ULONG   ulTitle,
  1118.       [in]  DWORD   dwFlags,  
  1119.       [out] IDvdCmd** ppCmd 
  1120.     );
  1121.  
  1122.     // PlayChapterInTitle
  1123.     //
  1124.     // Start playing from the beginning of the given chapter (or part-of-title) number
  1125.     // within the specified title number.
  1126.     // Annex J: PTT_Play
  1127.     // Title numbers range between 1 and 99.
  1128.     // Chapters range from 1 to 999.
  1129.     HRESULT PlayChapterInTitle
  1130.     ( [in]  ULONG   ulTitle, 
  1131.       [in]  ULONG   ulChapter,
  1132.       [in]  DWORD   dwFlags,  
  1133.       [out] IDvdCmd** ppCmd 
  1134.     );
  1135.  
  1136.     // PlayAtTimeInTitle
  1137.     //
  1138.     // Start playing from the specified time within the specified title number.
  1139.     // NOTE: the actual start time will be the closest sync point before
  1140.     // or equal to the specified frame number.
  1141.     // Annex J: Time_Play
  1142.     // Title numbers range between 1 and 99.
  1143.     HRESULT PlayAtTimeInTitle
  1144.     ( [in]  ULONG   ulTitle,
  1145.       [in]  DVD_HMSF_TIMECODE*   pStartTime,
  1146.       [in]  DWORD   dwFlags,  
  1147.       [out] IDvdCmd** ppCmd 
  1148.     );
  1149.  
  1150.     // Stop
  1151.     // Stop playback by transferring DVD Navigator to the DVD "Stop State" (same 
  1152.     // as DVD_DOMAIN_Stop), but filter graph remains in DirectShow's Run state.
  1153.     // Annex J: Stop
  1154.     HRESULT Stop();
  1155.  
  1156.     // ReturnFromSubmenu
  1157.     //
  1158.     // Stop playback of current program chain (PGC) and start playing the PGC 
  1159.     // specified by "GoUp_PGCN".in the PGCI.
  1160.     // If the GoUp_PGCN value is 0xFFFF the Resume() operation is carried out.
  1161.     // Annex J: GoUp
  1162.     HRESULT ReturnFromSubmenu(
  1163.       [in]  DWORD   dwFlags,  
  1164.       [out] IDvdCmd** ppCmd );
  1165.  
  1166.     // PlayAtTime
  1167.     // Start playing at the specified time within the current title.
  1168.     // NOTE: the actual start time will be the closest sync point before
  1169.     // or equal to the specified frame number.
  1170.     // Annex J: Time_Search
  1171.     // The time is in BCD format, passed in as a ULONG.
  1172.     HRESULT PlayAtTime
  1173.     ( [in]  DVD_HMSF_TIMECODE* pTime,
  1174.       [in]  DWORD   dwFlags,  
  1175.       [out] IDvdCmd** ppCmd 
  1176.     );
  1177.  
  1178.     // PlayChapter
  1179.     // Start playing at the specified chapter (or part-of-title) within
  1180.     // the current title.
  1181.     // Annex J: PTT_Search
  1182.     // Chapters range from 1 to 999.
  1183.     HRESULT PlayChapter
  1184.     ( [in]  ULONG   ulChapter,
  1185.       [in]  DWORD   dwFlags,  
  1186.       [out] IDvdCmd** ppCmd 
  1187.     );
  1188.  
  1189.     // PlayPrevChapter
  1190.     // Start playing at the beginning of the previous DVD "program".
  1191.     // For One-Sequential_PGC_Titles (which includes most titles) a program 
  1192.     // is equivalent to a chapter, otherwise a program is part of a chapter. 
  1193.     // Annex J: PrevPG_Search
  1194.     HRESULT PlayPrevChapter(
  1195.       [in]  DWORD   dwFlags,  
  1196.       [out] IDvdCmd** ppCmd );
  1197.  
  1198.     // ReplayChapter
  1199.     // Start playing from the beginning of they current program.
  1200.     // Annex J: TopPG_Search
  1201.     HRESULT ReplayChapter(
  1202.       [in]  DWORD   dwFlags,  
  1203.       [out] IDvdCmd** ppCmd );
  1204.  
  1205.     // PlayNextChapter
  1206.     // Start playing from the beginning of the next program.
  1207.     // Annex J: NextPG_Search
  1208.     HRESULT PlayNextChapter(
  1209.       [in]  DWORD   dwFlags,  
  1210.       [out] IDvdCmd** ppCmd );
  1211.  
  1212.     // PlayForwards
  1213.     // Set forward play at the specified speed.  
  1214.     // Annex J: Forward_Scan
  1215.     //      dSpeed == 1 is normal play
  1216.     //      dSpeed  < 1 is slow play
  1217.     //      dSpeed  > 1 is fast play
  1218.     // For dSpeed != 1, audio and subpicture is muted.
  1219.     HRESULT PlayForwards
  1220.     ( [in]  double  dSpeed,
  1221.       [in]  DWORD   dwFlags,  
  1222.       [out] IDvdCmd** ppCmd
  1223.     );
  1224.  
  1225.     // PlayBackwards
  1226.     // Set reverse play at the specified speed.  
  1227.     // Annex J: Backward_Scan
  1228.     //      dSpeed == 1 is normal play speed in reverse
  1229.     //      dSpeed  < 1 is slow play in reverse
  1230.     //      dSpeed  > 1 is fast play in reverse
  1231.     // For reverse play, audio and subpicture are always muted.
  1232.     HRESULT PlayBackwards
  1233.     ( [in]  double  dSpeed,
  1234.       [in]  DWORD   dwFlags,  
  1235.       [out] IDvdCmd** ppCmd
  1236.     );
  1237.  
  1238.     // ShowMenu
  1239.     // Start playback of the Menu specified by an enum DVD_MENU_ID.
  1240.     // Annex J: Menu_Call
  1241.     HRESULT ShowMenu
  1242.     ( [in]  DVD_MENU_ID   MenuID,
  1243.       [in]  DWORD   dwFlags,  
  1244.       [out] IDvdCmd** ppCmd  
  1245.     );
  1246.  
  1247.     // Resume
  1248.     // Returns to title playback in DVD_DOMAIN_Title. This is typically
  1249.     // done after MenuCall which puts the DVD Navigator in 
  1250.     // DVD_DOMAIN_VideoTitleSetMenu or DVD_DOMAIN_VideoManagerMenu.
  1251.     // Annex J: Resume
  1252.     HRESULT Resume(
  1253.       [in]  DWORD   dwFlags,  
  1254.       [out] IDvdCmd** ppCmd );
  1255.  
  1256.     // SelectRelativeButton
  1257.     // Moves the selection highlight above, below, to the left of, or to the right of the
  1258.     // currently selected.
  1259.     // "Selecting" a DVD button simply highlights the button but does
  1260.     // not "Activate" the button.  Selecting is the Windows equivalent 
  1261.     // to tabbing to a button but not pressing the space bar or enter key.
  1262.     // Activating is the Windows equivalent of pressing the space bar or
  1263.     // enter key after tabbing to a button.
  1264.     // Annex J: Upper_button_Select, Lower_button_Select, Left_button_Select, Right_button_Select
  1265.     HRESULT SelectRelativeButton( DVD_RELATIVE_BUTTON buttonDir );
  1266.  
  1267.     // ActivateButton
  1268.     // Activates current button.
  1269.     // Annex J: Button_Activate
  1270.     HRESULT ActivateButton();
  1271.  
  1272.     // SelectButton
  1273.     // Selects a specific button (with the index from 1 to 36).
  1274.     // ulButton is intended to be a number entered by a user corresponding
  1275.     // to button numbers currently displayed on screen.  
  1276.     // Button numbers range from 1 to 36.
  1277.     HRESULT SelectButton
  1278.     ( [in]  ULONG   ulButton
  1279.     );
  1280.  
  1281.     // SelectAndActivateButton
  1282.     // Selects and then activates the button specified by the user.  
  1283.     // ulButton is intended to be a number entered by a user corresponding
  1284.     // to button numbers currently displayed on screen.  
  1285.     // Annex J: Button_Select_And_Activate
  1286.     // Button numbers range from 1 to 36.
  1287.     HRESULT SelectAndActivateButton
  1288.     ( [in]  ULONG   ulButton
  1289.     );
  1290.  
  1291.     // StillOff
  1292.     // Releases any current still if there are no available buttons.
  1293.     // This includes VOBU stills, Cell stills, and PGC stills, whether the 
  1294.     // still is infinite.  When buttons are available, stills are released by
  1295.     // activating a button.  Note this does not release a Pause.
  1296.     // Annex J: Still_Off
  1297.     HRESULT StillOff();
  1298.  
  1299.     // Pause
  1300.     // Freezes / unfreezes playback and any internal timers. This is similar to
  1301.     // IMediaControl::Pause(), but not the same in effect as IMediaControl::Pause
  1302.     // puts the filter (all filters, if done to the graph) in paused state.
  1303.     // Annex J: Pause_On and Pause_Off
  1304.     // bState is TRUE or FALSE to indicate whether to do Puase_on/Pause_Off according
  1305.     // to Annex J terminology.
  1306.     HRESULT Pause
  1307.     ( [in]  BOOL   bState
  1308.     );
  1309.  
  1310.     // SelectAudioStream
  1311.     // Changes the current audio stream to ulAudio.
  1312.     // Annex J: Audio_Stream_Change
  1313.     // Audio stream number ranges between 0 and 7 or DEFAULT_AUDIO_STREAM (15 - default based on default language & language extension)
  1314.     HRESULT SelectAudioStream
  1315.     ( [in]  ULONG   ulAudio,
  1316.       [in]  DWORD dwFlags,  
  1317.       [out] IDvdCmd** ppCmd 
  1318.  
  1319.     );
  1320.  
  1321.     // SelectSubpictureStream
  1322.     // Changes the current subpicture stream number to ulSubPicture
  1323.     // Annex J: Sub-picture_Stream_Change (first param)
  1324.     // Subpicture stream number should be between 0 and 31 or 63.
  1325.     HRESULT SelectSubpictureStream
  1326.     ( [in]  ULONG   ulSubPicture,
  1327.       [in]  DWORD dwFlags,  
  1328.       [out] IDvdCmd** ppCmd 
  1329.  
  1330.     );
  1331.  
  1332.     // SetSubpictureState
  1333.     // Turns on/off current subpicture stream display.
  1334.     // Annex J: Sub-picture_Stream_Change (second param)
  1335.     // Subpicture state is On or Off (TRUE or FALSE)
  1336.     HRESULT SetSubpictureState
  1337.     ( [in]  BOOL    bState,
  1338.       [in]  DWORD dwFlags,  
  1339.       [out] IDvdCmd** ppCmd
  1340.     );
  1341.  
  1342.     // SelectAngle
  1343.     // Changes the current angle number.
  1344.     // Annex J: Angle_Change
  1345.     // Angle number is between 1 and 9.
  1346.     HRESULT SelectAngle
  1347.     ( [in]  ULONG   ulAngle,
  1348.       [in]  DWORD dwFlags,  
  1349.       [out] IDvdCmd** ppCmd
  1350.     );
  1351.  
  1352.     // SelectParentalLevel
  1353.     // Selects the current player parental level.  
  1354.     // Annex J: Parental_Level_Select
  1355.     // Parental level ranges between 1 and 8.
  1356.     // The defined parental levels are listed below :
  1357.     //
  1358.     //      Level   Rating  
  1359.     //      -----   ------  
  1360.     //      1       G       
  1361.     //      3       PG      
  1362.     //      4       PG13    
  1363.     //      6       R       
  1364.     //      7       NC17    
  1365.     // Higher levels can play lower level content; lower levels cannot play 
  1366.     // higher level content.  The DVD Navigator provides no restriction on
  1367.     // setting the parental level.  DVD player application may enforce 
  1368.     // restriction on parental level setting, such as password protection for 
  1369.     // raising the current parental level.  Parental Management is disabled in
  1370.     // the Navigator by default.
  1371.     //
  1372.     // Note : To disable parental management, pass 0xffffffff for ulParentalLevel
  1373.     //        If parental management is disabled, then the player will play the
  1374.     //        first PGC in a parental block regardless of parental IDs.
  1375.     //
  1376.     HRESULT SelectParentalLevel
  1377.     ( [in]  ULONG   ulParentalLevel  
  1378.     );
  1379.  
  1380.     // SelectParentalCountry
  1381.     // Sets the country in which to interpret the Parental Level.
  1382.     // Annex J: Parental_Country_Select
  1383.     // The country specified using the Alpha-2 code of the ISO-3166 standard,
  1384.     HRESULT SelectParentalCountry
  1385.     ( [in]  BYTE    bCountry[2]
  1386.     );
  1387.  
  1388.     // SelectKaraokeAudioPresentationMode
  1389.     // Sets the Karaoke audio mode.  
  1390.     // Annex J: Karaoke_Audio_Presentation_Mode_Change
  1391.     // NOTE: This and all other Karoke support is currently not implemented.
  1392.     // Mode represents the audio mixing mode for Karaoke (same info as SPRM11).
  1393.     // Use a bitwise OR of the bits in DVD_KARAOKE_DOWNMIX
  1394.     HRESULT SelectKaraokeAudioPresentationMode
  1395.     ( [in] ULONG    ulMode
  1396.     );
  1397.  
  1398.     // SelectVideoModePreference
  1399.     // The user can specify the (initial) preferred display mode (aspect ratio) 
  1400.     // (wide / letterbox / pan-scan) that should be used to display content
  1401.     // (16 : 9).
  1402.     // Annex J: Video_Presentation_Mode_Change
  1403.     // The parameter is a ULONG that has one of the values defined in 
  1404.     // DVD_PREFERRED_DISPLAY_MODE
  1405.     HRESULT SelectVideoModePreference
  1406.     ( [in]  ULONG    ulPreferredDisplayMode
  1407.     );
  1408.     
  1409.     // SetDVDDirectory
  1410.     // Sets the root directory containing the DVD-Video volume. 
  1411.     // Can only be called from the DVD Stop State (DVD_DOMAIN_Stop).
  1412.     // If the root directory is not successfully set before 
  1413.     // IMediaControl::Play is called, the first drive starting from c:
  1414.     // containing a VIDEO_TS directory in the top level directory
  1415.     // will be used as the root.
  1416.     HRESULT SetDVDDirectory
  1417.     ( [in]  LPCWSTR     pszwPath
  1418.     );
  1419.  
  1420.     // ActivateAtPosition
  1421.     // This is typically called in response to a mouse click.
  1422.     // The specified point within the display window is to see if it is
  1423.     // within a current DVD button's highlight rect.  If it is, that 
  1424.     // button is first selected, then activated.  
  1425.     // NOTE: DVD Buttons do not all necessarily have highlight rects,
  1426.     // button rects can overlap, and button rects do not always
  1427.     // correspond to the visual representation of DVD buttons.
  1428.     HRESULT ActivateAtPosition    // typically called after a mouse click
  1429.     ( [in]  POINT       point
  1430.     );
  1431.  
  1432.     // SelectAtPosition
  1433.     // This is typically called in response to a mouse move within the 
  1434.     // display window.
  1435.     // The specified point within the display window is to see if it is
  1436.     // within a current DVD button's highlight rect.  If it is, that 
  1437.     // button is selected.
  1438.     // NOTE: DVD Buttons do not all necessarily have highlight rects,
  1439.     // button rects can overlap, and button rects do not always
  1440.     // correspond to the visual representation of DVD buttons.
  1441.     HRESULT SelectAtPosition    // typically called after a mouse move
  1442.     ( [in]  POINT       point
  1443.     );
  1444.     
  1445.     // PlayChaptersAutoStop
  1446.     // Start playing at the specified chapter within the specified title
  1447.     // and play the number of chapters specified by the third parameter.
  1448.     // Then the playback stops by sending an event EC_DVD_CHAPTER_AUTOSTOP.
  1449.     // Title ranges from 1 to 99.
  1450.     // Chapter (and number of chapters to play) ranges from 1 to 999.
  1451.     HRESULT PlayChaptersAutoStop
  1452.     ( [in] ULONG ulTitle,           // title number
  1453.       [in] ULONG ulChapter,         // chapter number to start playback
  1454.       [in] ULONG ulChaptersToPlay,   // number of chapters to play from the start chapter
  1455.       [in] DWORD dwFlags,  
  1456.       [out] IDvdCmd** ppCmd 
  1457.     );
  1458.  
  1459.      // AcceptParentalLevelChange
  1460.     //
  1461.     // Application's way of informing the Navigator that the required parental 
  1462.     // level change indicated through a previous event was accepted or rejected 
  1463.     // by the app (and unblock the Navigator).
  1464.     //
  1465.     // FALSE - reject the disc's request to change the current parental level.
  1466.     // TRUE  - change the parental level as required by the disc.
  1467.     HRESULT AcceptParentalLevelChange
  1468.     ( [in] BOOL bAccept
  1469.     );
  1470.  
  1471.     // SetOption(flag, true/false )
  1472.     // Flags:
  1473.     //
  1474.     // DVD_ResetOnStop
  1475.     //      Disable reset of the Navigator's internal state on the 
  1476.     //      subsequent IMediaControl::Stop() call(s).
  1477.     //
  1478.     //      FALSE - Navigator does not reset its state on the subsequent Stop calls 
  1479.     //              (play from the current location on next Run call).
  1480.     //      TRUE  - (default) Navigator resets its state on the subsequent Stop call 
  1481.     //              (play from the first play PGC on the Run call after the Stop).
  1482.     //
  1483.     // DVD_NotifyParentalLevelChange
  1484.     //
  1485.     //      Allows the application to indicate to the Navigator that it wants to control 
  1486.     //      parent level change (e.g., through a dialog box) and indicate the acceptance
  1487.     //      or rejection of the new parental level to the Navigator through 
  1488.     //      AcceptParentalLevelChange().
  1489.     //
  1490.     //      FALSE - disable (default).  Always reject request by the disc to change parental level.
  1491.     //      TRUE  - enable.  Navigator will send the app a 'EC_DVD_PARENTAL_LEVEL_CHANGE' event
  1492.     //              and block until AcceptParentalLevelChange() is called by the app.
  1493.     //
  1494.     // DVD_HMSF_TimeCodeEvents
  1495.     //
  1496.     //      Lets the application specify to the Navigator if it wants to get the new time
  1497.     //      event EC_DVD_CURRENT_HMSF_TIME with the HMSF format rather than the older 
  1498.     //      EC_DVD_CURRENT_TIME events.
  1499.     //
  1500.     //      FALSE - disable (default).  Older EC_DVD_CURRENT_TIME events are returned.
  1501.     //      TRUE  - enable.  Navigator will send the app EC_DVD_CURRENT_HMSF_TIME events.
  1502.  
  1503.     HRESULT SetOption
  1504.     ( [in] DVD_OPTION_FLAG flag,
  1505.       [in] BOOL fState
  1506.     );
  1507.  
  1508.     // SetState
  1509.     //
  1510.     // The navigator will use the location information in the given state object to restore
  1511.     // the navigator's position to a specific location on the disc.
  1512.     // A valid state object is returned by either calling GetState(), or by using
  1513.     // "CoCreateInstance( CLSID_DVDState, NULL, CLSCTX_INPROC_SERVER, IID_IDvdState, (void **) ppState )"
  1514.     // to create a state object, followed by pState->IPersist::Load() to read it from memory or disk. 
  1515.     //
  1516.     HRESULT SetState
  1517.     ( [in] IDvdState* pState,
  1518.       [in]  DWORD     dwFlags,  
  1519.       [out] IDvdCmd** ppCmd
  1520.  
  1521.     );
  1522.  
  1523.     // PlayPeriodInTitleAutoStop
  1524.     //
  1525.     // Start playing from the specified time within the specified title number until the specified end time.
  1526.     // NOTE: the actual start and end times will be the closest sync points before
  1527.     // or equal to the specified frame number.
  1528.     // Annex J: Time_Play for a limited range
  1529.     // Title numbers range between 1 and 99.
  1530.     HRESULT PlayPeriodInTitleAutoStop
  1531.     ( [in]  ULONG   ulTitle,
  1532.       [in]  DVD_HMSF_TIMECODE*   pStartTime,
  1533.       [in]  DVD_HMSF_TIMECODE*   pEndTime,
  1534.       [in]  DWORD   dwFlags,  
  1535.       [out] IDvdCmd** ppCmd 
  1536.     );
  1537.  
  1538.     // SetGPRM
  1539.     // Sets the current contents of a DVD General Parameter Register.
  1540.     // Use of GPRMs is title specific.
  1541.  
  1542.     HRESULT SetGPRM
  1543.     ( [in] ULONG  ulIndex,
  1544.       [in] WORD   wValue,
  1545.       [in]  DWORD   dwFlags,  
  1546.       [out] IDvdCmd** ppCmd
  1547.     );
  1548.  
  1549.     // SelectDefaultMenuLanguage
  1550.     // Selects the default language for menus.  
  1551.     // Languages are specified with Windows standard LCIDs.  LCIDs can be created 
  1552.     // from ISO-639 codes with
  1553.     // MAKELCID( MAKELANGID(wISO639LangID ,SUBLANG_DEFAULT ), SORT_DEFAULT ).
  1554.     // SelectMenuLanguage may only called from the DVD Stop state (DVD_DOMAIN_Stop).
  1555.     // Annex J: Menu_Language_Select
  1556.     //
  1557.     // NOT TRUE ANYMORE:
  1558.     // NOTE: MAKELANGID seems to have a bug so 'jp' may have to be used 
  1559.     // instead of 'ja' for the ISO639 code for Japanese.
  1560.     HRESULT SelectDefaultMenuLanguage
  1561.     ( [in]  LCID    Language
  1562.     );
  1563.  
  1564.     // SelectDefaultAudioLanguage 
  1565.     // Selects the default audio language.  
  1566.     // Languages are specified with Windows standard LCIDs.
  1567.     HRESULT SelectDefaultAudioLanguage
  1568.     ( [in]  LCID    Language,
  1569.       [in] DVD_AUDIO_LANG_EXT   audioExtension
  1570.     );
  1571.  
  1572.     // SelectDefaultSubpictureLanguage 
  1573.     // Selects the default subpicture language.  
  1574.     // Languages are specified with Windows standard LCIDs.
  1575.     HRESULT SelectDefaultSubpictureLanguage
  1576.     ( [in] LCID    Language,
  1577.       [in] DVD_SUBPICTURE_LANG_EXT  subpictureExtension
  1578.     );
  1579. }
  1580.  
  1581.  
  1582. //==========================================================================
  1583. //==========================================================================
  1584. // IDvdInfo2 interface -- allows an app to query for attributes of available 
  1585. // DVD titles and DVD player status.  Also allows for control of a DVD 
  1586. // player beyond Annex J in the DVD spec.
  1587. //==========================================================================
  1588. //==========================================================================
  1589.  
  1590. enum DVD_TextStringType {
  1591.     // disc structure (0x00..0x0f)
  1592.     DVD_Struct_Volume               = 0x01, 
  1593.     DVD_Struct_Title                = 0x02, 
  1594.     DVD_Struct_ParentalID           = 0x03,
  1595.     DVD_Struct_PartOfTitle          = 0x04,
  1596.     DVD_Struct_Cell                 = 0x05,
  1597.     // stream (0x10..0x1f)
  1598.     DVD_Stream_Audio                = 0x10,
  1599.     DVD_Stream_Subpicture           = 0x11,
  1600.     DVD_Stream_Angle                = 0x12,
  1601.     // channel in stream (0x20..0x2f)
  1602.     DVD_Channel_Audio               = 0x20,
  1603.  
  1604.     // Application information
  1605.     // General (0x30..0x37)
  1606.     DVD_General_Name                = 0x30,
  1607.     DVD_General_Comments            = 0x31,
  1608.  
  1609.     // Title (0x38..0x3f)
  1610.     DVD_Title_Series                = 0x38,
  1611.     DVD_Title_Movie                 = 0x39,
  1612.     DVD_Title_Video                 = 0x3a,
  1613.     DVD_Title_Album                 = 0x3b,
  1614.     DVD_Title_Song                  = 0x3c,
  1615.     DVD_Title_Other                 = 0x3f,
  1616.  
  1617.     // Title (sub) (0x40..0x47)
  1618.     DVD_Title_Sub_Series            = 0x40,
  1619.     DVD_Title_Sub_Movie             = 0x41,
  1620.     DVD_Title_Sub_Video             = 0x42,
  1621.     DVD_Title_Sub_Album             = 0x43,
  1622.     DVD_Title_Sub_Song              = 0x44,
  1623.     DVD_Title_Sub_Other             = 0x47,
  1624.  
  1625.     // Title (original) (0x48..0x4f)
  1626.     DVD_Title_Orig_Series           = 0x48,
  1627.     DVD_Title_Orig_Movie            = 0x49,
  1628.     DVD_Title_Orig_Video            = 0x4a,
  1629.     DVD_Title_Orig_Album            = 0x4b,
  1630.     DVD_Title_Orig_Song             = 0x4c,
  1631.     DVD_Title_Orig_Other            = 0x4f,
  1632.  
  1633.     // Other info (0x50..0x57)
  1634.     DVD_Other_Scene                 = 0x50,
  1635.     DVD_Other_Cut                   = 0x51,
  1636.     DVD_Other_Take                  = 0x52,
  1637.  
  1638.     // Language     0x58..0x5b
  1639.     // Work         0x5c..0x6b
  1640.     // Character    0x6c..0x8f
  1641.     // Data         0x90..0x93
  1642.     // Karaoke      0x94..0x9b
  1643.     // Category     0x9c..0x9f
  1644.     // Lyrics       0xa0..0xa3
  1645.     // Document     0xa4..0xa7
  1646.     // Others       0xa8..0xab
  1647.     // Reserved     0xac..0xaf
  1648.     // Admin        0xb0..0xb7
  1649.     // more admin   0xb8..0xc0
  1650.     // Reserved     0xd0..0xdf
  1651.     // vendor       0xe0..0xef
  1652.     // extension    0xf0..0xf7
  1653.     // reserved     0xf8..0xff
  1654. };
  1655.  
  1656. enum DVD_TextCharSet {
  1657.     DVD_CharSet_Unicode                       = 0,
  1658.     DVD_CharSet_ISO646                        = 1,
  1659.     DVD_CharSet_JIS_Roman_Kanji               = 2,
  1660.     DVD_CharSet_ISO8859_1                     = 3,
  1661.     DVD_CharSet_ShiftJIS_Kanji_Roman_Katakana = 4
  1662. };
  1663.  
  1664. cpp_quote ("#define DVD_TITLE_MENU                0x000")
  1665. cpp_quote ("#define DVD_STREAM_DATA_CURRENT     0x800")
  1666. cpp_quote ("#define DVD_STREAM_DATA_VMGM        0x400")
  1667. cpp_quote ("#define DVD_STREAM_DATA_VTSM        0x401")
  1668. cpp_quote ("#define DVD_DEFAULT_AUDIO_STREAM    0x0f")
  1669.  
  1670. // DVD Decoder Caps data
  1671. typedef struct tagDVD_DECODER_CAPS
  1672. {
  1673.     DWORD   dwSize ;            // size of this struct
  1674.     DWORD   dwAudioCaps ;       // bits indicating audio support (AC3, DTS, SDDS, LPCM etc.) of decoder
  1675.     double  dFwdMaxRateVideo ;  // max data rate for video going forward
  1676.     double  dFwdMaxRateAudio ;  // ...  ..   ..  ... audio  ...    ...
  1677.     double  dFwdMaxRateSP ;     // ...  ..   ..  ...   SP   ...    ...
  1678.     double  dBwdMaxRateVideo ;  // if smooth reverse is not available, this will be set to 0
  1679.     double  dBwdMaxRateAudio ;  //   -- ditto --
  1680.     double  dBwdMaxRateSP ;     //   -- ditto --
  1681.     DWORD   dwRes1 ;            // reserved for future expansion
  1682.     DWORD   dwRes2 ;            //   -- ditto --
  1683.     DWORD   dwRes3 ;            //   -- ditto --
  1684.     DWORD   dwRes4 ;            //   -- ditto --
  1685. } DVD_DECODER_CAPS ;
  1686.  
  1687. // Bits for decoder's audio format support
  1688. cpp_quote ("#define DVD_AUDIO_CAPS_AC3        0x00000001")
  1689. cpp_quote ("#define DVD_AUDIO_CAPS_MPEG2    0x00000002")
  1690. cpp_quote ("#define DVD_AUDIO_CAPS_LPCM        0x00000004")
  1691. cpp_quote ("#define DVD_AUDIO_CAPS_DTS        0x00000008")
  1692. cpp_quote ("#define DVD_AUDIO_CAPS_SDDS        0x00000010")
  1693.  
  1694.  
  1695. [
  1696. object,
  1697. uuid(34151510-EEC0-11D2-8201-00A0C9D74842),
  1698. pointer_default(unique)
  1699. ]
  1700.  
  1701. interface IDvdInfo2 : IUnknown {
  1702.     import "unknwn.idl";
  1703.  
  1704.     // GetCurrentDomain
  1705.     // Returns the current DVD Domain of the DVD player.
  1706.     HRESULT GetCurrentDomain
  1707.     ( [out] DVD_DOMAIN *pDomain 
  1708.     );
  1709.  
  1710.     // GetCurrentLocation
  1711.     // Returns information sufficient to restart playback of a video
  1712.     // from the current playback location in titles that don't explicitly
  1713.     // disable seeking to the current location.
  1714.     HRESULT GetCurrentLocation
  1715.     ( [out] DVD_PLAYBACK_LOCATION2 *pLocation
  1716.     );
  1717.  
  1718.     // GetTotalTitleTime
  1719.     // Returns the total playback time for the current title.  Only works
  1720.     // for One_Sequential_PGC_Titles.
  1721.     // THIS SHOULD CHANGE, RIGHT?
  1722.     HRESULT GetTotalTitleTime
  1723.     ( [out] DVD_HMSF_TIMECODE* pTotalTime,
  1724.       [out] ULONG* ulTimeCodeFlags  // union of DVD_TIMECODE_FLAGS
  1725.     );
  1726.  
  1727.     // GetCurrentButton
  1728.     // Indicates the number of currently available buttons and the current
  1729.     // selected button number. If buttons are not present it returns 0 for
  1730.     // both pulButtonsAvailable and pulCurrentButton
  1731.     HRESULT GetCurrentButton
  1732.     ( [out] ULONG *    pulButtonsAvailable,
  1733.       [out] ULONG *    pulCurrentButton
  1734.     );
  1735.  
  1736.     // GetCurrentAngle
  1737.     // Indicates the number of currently available angles and the current
  1738.     // selected angle number.  If *pulAnglesAvailable is returned as 1 then 
  1739.     // the current content is not multiangle.
  1740.     HRESULT GetCurrentAngle
  1741.     ( [out] ULONG *    pulAnglesAvailable,
  1742.       [out] ULONG *    pulCurrentAngle
  1743.     );
  1744.  
  1745.     // GetCurrentAudio
  1746.     // Indicates the number of currently available audio streams and 
  1747.     // the currently selected audio stream number.
  1748.     // This only works inside the Title domain.
  1749.     HRESULT GetCurrentAudio
  1750.     ( [out] ULONG *    pulStreamsAvailable,
  1751.       [out] ULONG *    pulCurrentStream
  1752.     );
  1753.  
  1754.     // GetCurrentSubpicture
  1755.     // Indicates the number of currently available subpicture streams,
  1756.     // the currently selected subpicture stream number, and if the 
  1757.     // subpicture display is currently disabled.  Subpicture streams 
  1758.     // authored as "Forcedly Activated" stream will be displayed even if
  1759.     // subpicture display has been disabled by the app with 
  1760.     // IDVDControl::SetSubpictureState.
  1761.     // This only works inside the Title domain.
  1762.     HRESULT GetCurrentSubpicture
  1763.     ( [out] ULONG *    pulStreamsAvailable,
  1764.       [out] ULONG *    pulCurrentStream,
  1765.       [out] BOOL *     pbIsDisabled
  1766.     );
  1767.  
  1768.     // GetCurrentUOPS
  1769.     // Indicates which IDVDControl methods (Annex J user operations) are 
  1770.     // currently valid.  DVD titles can enable or disable individual user 
  1771.     // operations at almost any point during playback.
  1772.     HRESULT GetCurrentUOPS  
  1773.     ( [out] ULONG *   pulUOPs
  1774.     );
  1775.  
  1776.     // GetAllSPRMs
  1777.     // Returns the current contents of all DVD System Parameter Registers.
  1778.     // See DVD-Video spec for use of individual registers.
  1779.     // WE SHOULD DOC THE SPRMs RATHER THAN ASKING TO REFER TO DVD SPEC.
  1780.     HRESULT GetAllSPRMs
  1781.     ( [out] SPRMARRAY * pRegisterArray
  1782.     );
  1783.  
  1784.     // GetAllGPRMs
  1785.     // Returns the current contents of all DVD General Parameter Registers.
  1786.     // Use of GPRMs is title specific.
  1787.     // WE SHOULD DOC THE GPRMs RATHER THAN ASKING TO REFER TO DVD SPEC.
  1788.     HRESULT GetAllGPRMs
  1789.     ( [out] GPRMARRAY * pRegisterArray
  1790.     );
  1791.  
  1792.     // GetAudioLanguage
  1793.     // Returns the language of the specified stream within the current title.
  1794.     // Does not return languages for menus.  Returns *pLanguage as 0 if the
  1795.     // stream does not include language.
  1796.     // Use Win32 API GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize)
  1797.     // to create a human readable string name from the returned LCID.
  1798.     HRESULT GetAudioLanguage
  1799.     ( [in]  ULONG        ulStream, 
  1800.       [out] LCID *       pLanguage
  1801.     );
  1802.  
  1803.     // GetSubpictureLanguage
  1804.     // Returns the language of the specified stream within the current title.
  1805.     // Does not return languages for menus.  Returns *pLanguage=0 as 0 if the
  1806.     // stream does not include language.
  1807.     // Use Win32 API GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize)
  1808.     // to create a human readable string name from the returned LCID.
  1809.     HRESULT GetSubpictureLanguage
  1810.     ( [in]  ULONG        ulStream, 
  1811.       [out] LCID *       pLanguage
  1812.     );
  1813.  
  1814.     // GetTitleAttributes
  1815.     // Returns attributes of all video, audio, and subpicture streams for the 
  1816.     // specified title including menus.  
  1817.     // If 0xffffffff is specified as ulTitle, attributes for the current title 
  1818.     // are returned.
  1819.     HRESULT GetTitleAttributes
  1820.     ( [in]  ULONG       ulTitle, // requested title number
  1821.       [out] DVD_MenuAttributes *   pMenu,
  1822.       [out] DVD_TitleAttributes *   pTitle       
  1823.     );
  1824.  
  1825.     // GetVMGAttributes
  1826.     // Returns attributes of all video, audio, and subpicture 
  1827.     // streams for Video Manager Menus.  This method suppliments GetTitleAttributes()
  1828.     // for some menus, such as the Title menu, which are in a separate group of 
  1829.     // streams called the VMG (Video Manager) and are not associated with any 
  1830.     // particular title number.
  1831.     HRESULT GetVMGAttributes
  1832.     ( [out] DVD_MenuAttributes*   pATR 
  1833.     );
  1834.  
  1835.     // GetCurrentVideoAttributes
  1836.     // Returns the video attributes for the current title or menu.
  1837.     //
  1838.     HRESULT GetCurrentVideoAttributes
  1839.     ( [out] DVD_VideoAttributes *   pATR       
  1840.     );
  1841.  
  1842.     // GetAudioAttributes
  1843.     // Returns the audio attributes for the specified stream in the current title 
  1844.     // or menu.
  1845.     HRESULT GetAudioAttributes
  1846.     ( [in]  ULONG ulStream,
  1847.       [out] DVD_AudioAttributes *pATR 
  1848.     );
  1849.  
  1850.     // GetKaraokeChannelContents
  1851.     // Returns the karaoke contents of each channel of the specified stream in the current title 
  1852.     // or menu.
  1853.     HRESULT GetKaraokeAttributes
  1854.     ( [in]  ULONG ulStream,
  1855.       [out] DVD_KaraokeAttributes* pAttributes
  1856.     );
  1857.  
  1858.     // GetSubpictureAttributes
  1859.     // Returns the subpicture attributes for the specified stream in the current
  1860.     // title or menu.
  1861.     HRESULT GetSubpictureAttributes
  1862.     ( [in]  ULONG ulStream,
  1863.       [out] DVD_SubpictureAttributes *pATR 
  1864.     );
  1865.  
  1866.     // GetDVDVolumeInfo
  1867.     // Returns current DVD volume information.
  1868.     HRESULT GetDVDVolumeInfo
  1869.     ( [out] ULONG *pulNumOfVolumes,  // number of volumes (disc sides?) in a volume set
  1870.       [out] ULONG *pulVolume,        // volume number for current DVD directory
  1871.       [out] DVD_DISC_SIDE *pSide,    // current disc side
  1872.       [out] ULONG *pulNumOfTitles    // number of titles available in this volume
  1873.     );
  1874.  
  1875.     // GetDVDTextNumberOfLanguages
  1876.     // Returns the number of text languages for the current DVD directory.
  1877.     // Should return some error code if no root directory is found.
  1878.     HRESULT GetDVDTextNumberOfLanguages
  1879.     ( [out] ULONG * pulNumOfLangs
  1880.     );
  1881.     
  1882.     // GetDVDTextLanguageInfo
  1883.     // Returns the text languages information (number of strings, language code, 
  1884.     // char set) for the specified language index.
  1885.     // Should return some error code if an invalid text index is specified.
  1886.     HRESULT GetDVDTextLanguageInfo
  1887.     ( [in] ULONG ulLangIndex,
  1888.       [out] ULONG* pulNumOfStrings, 
  1889.       [out] LCID* pLangCode, 
  1890.       [out] enum DVD_TextCharSet * pbCharacterSet
  1891.     );
  1892.  
  1893.     // GetDVDTextStringAsNative
  1894.     // Returns the text string as an array of bytes for the specified language 
  1895.     // index.and string index.
  1896.     // Should return some error code if an invalid text or string index is specified.
  1897.     // It also just returns the length of the string if pchBuffer is specified as NULL.
  1898.     HRESULT GetDVDTextStringAsNative
  1899.     ( [in] ULONG ulLangIndex, 
  1900.       [in] ULONG ulStringIndex, 
  1901.       [out] BYTE* pbBuffer, 
  1902.       [in] ULONG ulMaxBufferSize, 
  1903.       [out] ULONG* pulActualSize, 
  1904.       [out] enum DVD_TextStringType* pType
  1905.     );
  1906.  
  1907.     // GetDVDTextStringAsUnicode
  1908.     // Returns the text string in Unicode for the specified language index.and string index.
  1909.     // Should return some error code if an invalid text or string index is specified.
  1910.     // It also just returns the length of the string if pchBuffer is specified as NULL.
  1911.     HRESULT GetDVDTextStringAsUnicode
  1912.     ( [in] ULONG ulLangIndex, 
  1913.       [in] ULONG ulStringIndex, 
  1914.       [out] WCHAR* pchwBuffer, 
  1915.       [in] ULONG ulMaxBufferSize, 
  1916.       [out] ULONG* pulActualSize, 
  1917.       [out] enum DVD_TextStringType* pType
  1918.     );
  1919.  
  1920.     // GetPlayerParentalLevel
  1921.     // Returns the current parental level and the current country code that has 
  1922.     // been set in the system registers in player.
  1923.     // See Table 3.3.4-1 of the DVD-Video spec for the defined parental levels.
  1924.     // Valid Parental Levels range from 1 to 8 if parental management is enabled.
  1925.     // Returns 0xffffffff if parental management is disabled
  1926.     // See ISO3166 : Alpha-2 Code for the country codes.
  1927.     HRESULT GetPlayerParentalLevel
  1928.     ( [out] ULONG *pulParentalLevel,    // current parental level
  1929.       [out] BYTE pbCountryCode[2]       // current country code
  1930.     );
  1931.     
  1932.     //  GetNumberOfChapters
  1933.     //  Returns the number of chapters that are defined for a
  1934.     //  given title.
  1935.     HRESULT GetNumberOfChapters
  1936.     ( [in]  ULONG ulTitle,           // Title for which number of chapters is requested
  1937.       [out] ULONG *pulNumOfChapters  // Number of chapters for the specified title
  1938.     );
  1939.  
  1940.     // GetTitleParentalLevels
  1941.     // Returns the parental levels that are defined for a particular title. 
  1942.     // pulParentalLevels will be combination of DVD_PARENTAL_LEVEL_8, 
  1943.     // DVD_PARENTAL_LEVEL_6, or DVD_PARENTAL_LEVEL_1 OR-ed together
  1944.     HRESULT GetTitleParentalLevels
  1945.     ( [in]  ULONG ulTitle,            // Title for which parental levels are requested
  1946.       [out] ULONG *pulParentalLevels  // Parental levels defined for the title "OR"ed together
  1947.     );
  1948.  
  1949.     // GetDVDDirectory
  1950.     // Returns the root directory that is set in the player. If a valid root
  1951.     // has been found, it returns the root string. Otherwise, it returns 0 for
  1952.     // pcbActualSize indicating that a valid root directory has not been found
  1953.     // or initialized.
  1954.     //
  1955.     // !!! used to return LPTSTR. interface was changed to return
  1956.     // LPSTR (ansi) for compatibility. COM APIs should pass with
  1957.     // UNICODE strings only.
  1958.     // 
  1959.     HRESULT GetDVDDirectory
  1960.     ( [out, size_is(ulMaxSize)] LPWSTR pszwPath, // pointer to buffer to get root string
  1961.       [in]  ULONG ulMaxSize,                     // size of buffer in WCHARs passed in
  1962.       [out] ULONG *pulActualSize                 // size of actual data returned (in WCHARs)
  1963.     );
  1964.  
  1965.     
  1966.     // IsAudioStreamEnabled
  1967.     //
  1968.     // Determines if the specified audio stream is enabled/disabled in the current PGC.
  1969.     //
  1970.     // ulStreamNum - audio stream number to test
  1971.     // pbEnabled   - where to place the result
  1972.     HRESULT IsAudioStreamEnabled
  1973.     ( [in] ULONG ulStreamNum,   // stream number to test
  1974.       [out] BOOL *pbEnabled     // returned state
  1975.     );
  1976.  
  1977.     // GetDiscID
  1978.     //
  1979.     // If pszwPath is specified as NULL, DVD Navigator will use the current path
  1980.     // that would be returned by GetDVDDirectory() at this point.
  1981.     //
  1982.     // Returns a 64-bit identification number for the specified DVD disc.
  1983.     HRESULT GetDiscID
  1984.     ( [in] LPCWSTR pszwPath,         // root path (should we rather use const WCHAR*?)
  1985.       [out] ULONGLONG* pullDiscID  // 64-bit unique id for the disc
  1986.     ) ;
  1987.  
  1988.     // GetState
  1989.     //
  1990.     // The navigator will create a new state object and save the current location into it.
  1991.     // The state object can be used to restore the navigator the saved location at a later time.
  1992.     // A new IDvdState object is created (with a single AddRef) and returned in *pStateData.
  1993.     // The object must be Released() when the application is finished with it.
  1994.     //
  1995.     HRESULT GetState
  1996.     ( [out] IDvdState **pStateData // returned object
  1997.     );
  1998.  
  1999.     //
  2000.     // GetMenuLanguages
  2001.     //
  2002.     // Navigator gets all of the menu languages for the VMGM and VTSM domains.
  2003.     //
  2004.     HRESULT GetMenuLanguages
  2005.     ( [out] LCID *pLanguages,                     // data buffer (NULL returns #languages) 
  2006.       [in]  ULONG ulMaxLanguages,                  // maxiumum number of languages to retrieve
  2007.       [out] ULONG *pulActualLanguages              // actual number of languages retrieved
  2008.     );
  2009.  
  2010.     //
  2011.     // GetButtonAtPosition
  2012.     //
  2013.     // This is typically called in response to a mouse move within the 
  2014.     // display window.
  2015.     // It returns the button located at the specified point within the display window.
  2016.     // If no button is present at that position, then VFW_E_DVD_NO_BUTTON is returned.
  2017.     // Button indices start at 1. 
  2018.     //
  2019.     // NOTE: DVD Buttons do not all necessarily have highlight rects,
  2020.     // button rects can overlap, and button rects do not always
  2021.     // correspond to the visual representation of DVD buttons.
  2022.     HRESULT GetButtonAtPosition    // typically called after a mouse move
  2023.     ( [in]  POINT       point,
  2024.       [out] ULONG *pulButtonIndex
  2025.     );
  2026.  
  2027.     //
  2028.     // GetCmdFromEvent
  2029.     //
  2030.     // This method maps an EC_DVD_CMD_BEGIN/COMPLETE/CANCEL event's lParam1 into an AddRef'd
  2031.     // IDvdCmd pointer.  You must Release the returned pointer.  NULL is returned if the function
  2032.     // fails.
  2033.     //
  2034.     HRESULT GetCmdFromEvent
  2035.     ( [in]  LONG_PTR    lParam1,
  2036.       [out] IDvdCmd **pCmdObj
  2037.     );
  2038.  
  2039.     // GetDefaultMenuLanguage
  2040.     // Returns the default language for menus.
  2041.     HRESULT GetDefaultMenuLanguage
  2042.     ( [out] LCID *       pLanguage
  2043.     );
  2044.  
  2045.     // GetDefaultAudioLanguage 
  2046.     // Gets the default audio language.  
  2047.     // Languages are specified with Windows standard LCIDs.
  2048.     HRESULT GetDefaultAudioLanguage
  2049.     ( [out] LCID*    pLanguage,
  2050.       [out] DVD_AUDIO_LANG_EXT*   pAudioExtension
  2051.     );
  2052.  
  2053.     // GetDefaultSubpictureLanguage 
  2054.     // Gets the default subpicture language.  
  2055.     // Languages are specified with Windows standard LCIDs.
  2056.     HRESULT GetDefaultSubpictureLanguage
  2057.     ( [out] LCID*    pLanguage,
  2058.       [out] DVD_SUBPICTURE_LANG_EXT*  pSubpictureExtension
  2059.     );
  2060.  
  2061.     //
  2062.     // GetDecoderCaps:
  2063.     // Retrieves the DVD decoder's details about max data rate for video, audio
  2064.     // and subpicture (going backward and forward) as well as support for various
  2065.     // types of audio (AC3, MPEG2, DTS, SDDS, LPCM).
  2066.     //
  2067.     HRESULT GetDecoderCaps
  2068.     ( [out] DVD_DECODER_CAPS *pCaps
  2069.     ) ;
  2070.  
  2071.     //
  2072.     // GetButtonRect:
  2073.     // Retrieves the coordinates for a given button number
  2074.     //
  2075.     HRESULT GetButtonRect
  2076.     ( [in] ULONG  ulButton,
  2077.       [out] RECT *pRect
  2078.     ) ;
  2079.  
  2080.     // IsSubpictureStreamEnabled
  2081.     //
  2082.     // Determines if the specified subpicture stream is enabled/disabled in the current PGC.
  2083.     //
  2084.     // ulStreamNum - Subpicture stream number to test
  2085.     // pbEnabled   - where to place the result
  2086.     HRESULT IsSubpictureStreamEnabled
  2087.     ( [in] ULONG ulStreamNum,   // stream number to test
  2088.       [out] BOOL *pbEnabled     // returned state
  2089.     );
  2090. }
  2091.  
  2092.  
  2093.  
  2094. //==========================================================================
  2095. //==========================================================================
  2096. //
  2097. // typedefs used by IDvdGraphBuilder interface.
  2098. //
  2099. //==========================================================================
  2100. //==========================================================================
  2101.  
  2102. typedef enum _AM_DVD_GRAPH_FLAGS {
  2103.     AM_DVD_HWDEC_PREFER =  0x01,   // default 
  2104.     AM_DVD_HWDEC_ONLY   =  0x02,
  2105.     AM_DVD_SWDEC_PREFER =  0x04,
  2106.     AM_DVD_SWDEC_ONLY   =  0x08,
  2107.     AM_DVD_NOVPE        = 0x100,
  2108.     AM_DVD_VMR9_ONLY    = 0x800    // only use VMR9 (otherwise fail) for rendering
  2109. } AM_DVD_GRAPH_FLAGS ;
  2110.  
  2111. typedef enum _AM_DVD_STREAM_FLAGS {
  2112.     AM_DVD_STREAM_VIDEO  = 0x01,
  2113.     AM_DVD_STREAM_AUDIO  = 0x02,
  2114.     AM_DVD_STREAM_SUBPIC = 0x04
  2115. } AM_DVD_STREAM_FLAGS ;
  2116.  
  2117. typedef struct {
  2118.     HRESULT hrVPEStatus ;         // VPE mixing error code (0 => success)
  2119.     BOOL    bDvdVolInvalid ;      // Is specified DVD volume invalid?
  2120.     BOOL    bDvdVolUnknown ;      // Is DVD volume to be played not specified/not found?
  2121.     BOOL    bNoLine21In ;         // video decoder doesn't produce line21 (CC) data
  2122.     BOOL    bNoLine21Out ;        // can't show decoded line21 data as CC on video
  2123.     int     iNumStreams ;         // number of DVD streams to render
  2124.     int     iNumStreamsFailed ;   // number of streams failed to render
  2125.     DWORD   dwFailedStreamsFlag ; // combination of flags to indicate failed streams
  2126. } AM_DVD_RENDERSTATUS ;
  2127.  
  2128.  
  2129. // 
  2130. // IDvdGraphBuilder interface to build a filter graph for DVD-Video playback.
  2131. //
  2132.  
  2133. [
  2134.     object,
  2135.     local,
  2136.     uuid(FCC152B6-F372-11d0-8E00-00C04FD7C08B),
  2137.     pointer_default(unique)
  2138. ]
  2139. interface IDvdGraphBuilder : IUnknown {
  2140.  
  2141.     // Returns the IGraphBuilder interface for the filtergraph used by the
  2142.     // CDvdGraphBuilder object.
  2143.     // Remember to *ppGB->Release() when you're done with it
  2144.     HRESULT GetFiltergraph
  2145.     ( [out] IGraphBuilder **ppGB
  2146.     ) ;
  2147.  
  2148.     // Gets specific interface pointers in the DVD-Video playback graph to 
  2149.     // make DVD-Video playback development easier.
  2150.     // It helps get the following interfaces to control playback/show CC/
  2151.     // position window/control volume etc:
  2152.     // - IDvdControl, IDvdInfo
  2153.     // - IAMLine21Decoder
  2154.     // - IVideoWindow, IBasicVideo
  2155.     // - IBasicAudio
  2156.     // This method will return 
  2157.     // a) E_INVALIDARG if ppvIF is invalid
  2158.     // b) E_NOINTERFACE if riid is an IID we don't know about
  2159.     // c) VFW_E_DVD_GRAPHNOTREADY if the graph has not been built through 
  2160.     //    RenderDvdVideoVolume() yet.
  2161.     // Remember to *ppvIF->Release() when you're done with it
  2162.     HRESULT GetDvdInterface
  2163.     ( [in] REFIID riid,    // IID of the interface required
  2164.       [out] void **ppvIF   // returns pointer to the required interface
  2165.     ) ;
  2166.  
  2167.     // Builds a filter graph according to user specs for playing back a
  2168.     // DVD-Video volume.
  2169.     // This method returns S_FALSE if
  2170.     // 1.  the graph has been either built, but either
  2171.     //     a) VPE mixing doesn't work (app didn't use AM_DVD_NOVPE flag)
  2172.     //     b) video decoder doesn't produce line21 data
  2173.     //     c) line21 data couldn't be rendered (decoding/mixing problem)
  2174.     //     d) the call specified an invalid volume path or DVD Nav couldn't
  2175.     //        locate any DVD-Video volume to be played.
  2176.     // 2.  some streams didn't render (completely), but the others have
  2177.     //     been rendered so that the volume can be partially played back.
  2178.     // The status is indicated through the fields of the pStatus (out)
  2179.     // parameter.
  2180.     // About 1(a), the app will have enough info to tell the user that the
  2181.     // video won't be visible unless a TV is connected to the NTSC out 
  2182.     // port of the DVD decoder (presumably HW in this case).
  2183.     // For case 1(b) & (c), the app "can" put up a warning/informative message
  2184.     // that closed captioning is not available because of the decoder.
  2185.     // 1(d) helps an app to ask the user to insert a DVD-Video disc if none 
  2186.     // is specified/available in the drive when playback is started.
  2187.     // This method builds the graph even if 
  2188.     // - an invalid DVD-Video volume is specified
  2189.     // - the caller uses lpwszPathName = NULL to make the DVD Nav to locate
  2190.     //   the default volume to be played back, but DVD Nav doesn't find a 
  2191.     //   default DVD-Video volume to be played back.
  2192.     // An app can later specify the volume using IDvdControl::SetRoot() 
  2193.     // method.
  2194.     // #2 will help the app indicate to the user that some of the streams
  2195.     // can't be played.
  2196.     // 
  2197.     // The graph is built using filters based on the dwFlags value (to use 
  2198.     // HW decoders or SW decoders or a mix of them).
  2199.     // The dwFlags value is one of the values in AM_DVD_GRAPH_FLAGS enum
  2200.     // type.  The default value is AM_DVD_HWDEC_PREFER. None of the 
  2201.     // AM_DVD_HWDEC_xxx or AM_DVD_SWDEC_xxx flags can be mixed. However
  2202.     // AM_DVD_NOVPE can be OR-ed with any of the AM_DVD_HWDEC_xxx flags.
  2203.     //
  2204.     // The method returns S_OK if the playback graph is built successfully
  2205.     // with all the streams completely rendered and a valid DVD-Video volume 
  2206.     // is specified or a default one has been located.
  2207.     //
  2208.     // If the dwFlags specify conflicting options, E_INVALIDARG is returned.
  2209.     // If the graph building fails, the method returns one of the following 
  2210.     // error codes:
  2211.     //    VFW_E_DVD_RENDERFAIL, VFW_E_DVD_DECNOTENOUGH
  2212.     //
  2213.     HRESULT RenderDvdVideoVolume
  2214.     ( [in] LPCWSTR lpcwszPathName,  // Can be NULL too
  2215.       [in] DWORD dwFlags,           // 0 is the default (use max HW)
  2216.       [out] AM_DVD_RENDERSTATUS *pStatus // returns indications of ANY failure
  2217.     ) ;
  2218. }
  2219.  
  2220.  
  2221. //
  2222. //  DDraw Exclusive Mode Video standard COM interface for Overlay Mixer
  2223. //
  2224. [
  2225.     object,
  2226.     local,
  2227.     uuid(153ACC21-D83B-11d1-82BF-00A0C9696C8F),
  2228.     pointer_default(unique)
  2229. ]
  2230. interface IDDrawExclModeVideo : IUnknown {
  2231.     // set a ddraw object to be used by the overlay mixer. If even one of the pins
  2232.     // of the ovmixer is connected, then it won't start using the new ddraw obect
  2233.     // immediately but just cache it. It will start using it the next time, all its
  2234.     // pins are disconnected.
  2235.     HRESULT SetDDrawObject([in] IDirectDraw *pDDrawObject);
  2236.  
  2237.     // gets the ddraw object currently being used by the overlay mixer. If the app has not
  2238.     // set any ddraw object and the ovmixer has not yet allocated one, then *ppDDrawObject
  2239.     // will be set to NULL and *pbUsingExternal will be set TO FALSE. Otherwise *pbUsingExternal
  2240.     // will be set to TRUE if the ovmixer is currently USING an app given ddraw object and FALSE
  2241.     // othewise
  2242.     HRESULT GetDDrawObject([out] IDirectDraw **ppDDrawObject, 
  2243.                            [out] BOOL *pbUsingExternal);
  2244.  
  2245.     // set a primary surface to be used by the overlay mixer. If even one of the pins
  2246.     // of the ovmixer is connected, then it won't start using the new primary surface
  2247.     // immediately but just cache it. It will start using it the next time, all its
  2248.     // pins are disconnected.
  2249.     // Also when the ovmixer does start using an app given primary surface, it will delete
  2250.     // its output pin (and not draw its own colorkey) since the app is expected to do the
  2251.     // window management and drawing colorkey etc on the primary surface
  2252.     // This function makes sure that the surface provided exposes IDirectDrawSurface3, and 
  2253.     // is consistent with the ddraw object provided. 
  2254.     HRESULT SetDDrawSurface([in] IDirectDrawSurface *pDDrawSurface);
  2255.  
  2256.     // gets the ddraw surface currently being used by the overlay mixer. If the app has not
  2257.     // set any ddraw surface and the ovmixer has not yet allocated one, then *ppDDrawSurface
  2258.     // will be set to NULL and *pbUsingExternal will be set to FALSE. Otherwise *pbUsingExternal
  2259.     // will be set to TRUE if the ovmixer is curretnly USING an app given ddraw surface and FALSE
  2260.     // otherwise
  2261.     HRESULT GetDDrawSurface([out] IDirectDrawSurface **ppDDrawSurface, 
  2262.                             [out] BOOL *pbUsingExternal);
  2263.  
  2264.     // set draw paramters on the ovmixer (src and dest rect). Note that if the mode
  2265.     // of the ovmixer is set to LETTER_BOX, then the ovmixer might show the video in
  2266.     // only a subrect of *prcTarget (see IMixerPinConfig for details).
  2267.     HRESULT SetDrawParameters([in] const RECT * prcSource, 
  2268.                               [in] const RECT * prcTarget);
  2269.  
  2270.     // gets the current video size and picture aspect ratio of the primary stream of the overlay mixer
  2271.     // The app should look for the evene EC_VIDEO_SIZE_AR_CHANGED and on its receipt
  2272.     // call this function again
  2273.     HRESULT GetNativeVideoProps([out] DWORD *pdwVideoWidth, 
  2274.                                 [out] DWORD *pdwVideoHeight, 
  2275.                                 [out] DWORD *pdwPictAspectRatioX, 
  2276.                                 [out] DWORD *pdwPictAspectRatioY);
  2277.  
  2278.     // Set the callback interface - the callback interface will be defined in a later release
  2279.     // Currently returns E_NOTIMPL
  2280.     HRESULT SetCallbackInterface([in] IDDrawExclModeVideoCallback *pCallback, 
  2281.                                  [in] DWORD dwFlags);
  2282. }
  2283.  
  2284.  
  2285. //
  2286. //  DDraw Exclusive Mode Video callbacks
  2287. //
  2288.  
  2289. //  enum for flags 
  2290. enum _AM_OVERLAY_NOTIFY_FLAGS {
  2291.     AM_OVERLAY_NOTIFY_VISIBLE_CHANGE = 0x00000001,
  2292.     AM_OVERLAY_NOTIFY_SOURCE_CHANGE  = 0x00000002,
  2293.     AM_OVERLAY_NOTIFY_DEST_CHANGE    = 0x00000004
  2294. };
  2295. [
  2296.     object,
  2297.     local,
  2298.     uuid(913c24a0-20ab-11d2-9038-00a0c9697298),
  2299.     pointer_default(unique)
  2300. ]
  2301. interface IDDrawExclModeVideoCallback : IUnknown {
  2302.  
  2303.     //  Called once before UpdateOverlay is called with bBefore == TRUE
  2304.     //  and once after it is called with bBefore == FALSE and otherwise
  2305.     //  identical parameters
  2306.     HRESULT OnUpdateOverlay(
  2307.                             [in] BOOL bBefore, // After UpdateOverlayCalled?
  2308.                             [in] DWORD dwFlags,// _AM_OVERLAY_NOTIFY enum
  2309.                             [in] BOOL bOldVisible,
  2310.                             [in] const RECT *prcOldSrc,
  2311.                             [in] const RECT *prcOldDest,
  2312.                             [in] BOOL bNewVisible,
  2313.                             [in] const RECT *prcNewSrc,
  2314.                             [in] const RECT *prcNewDest);
  2315.  
  2316.      //  Called when the surface color key is changed
  2317.      HRESULT OnUpdateColorKey(
  2318.                               [in] const COLORKEY *pKey,
  2319.                               [in] DWORD dwColor);
  2320.  
  2321.      //  Called when the video size or aspect ratio changes
  2322.      HRESULT OnUpdateSize( [in] DWORD dwWidth,     // Movie pixel width
  2323.                            [in] DWORD dwHeight,    // Movie pixel height
  2324.                            [in] DWORD dwARWidth,   // Aspect ratio horizontal
  2325.                            [in] DWORD dwARHeight); // Aspect ratio vertical
  2326. }
  2327.